|
@@ -0,0 +1,160 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.caimei.modules.products.dao.CmMallProductLadderPriceDao">
|
|
|
+ <resultMap id="BaseResultMap" type="com.caimei.modules.products.entity.CmMallProductLadderPrice">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
+ <result column="productId" jdbcType="BIGINT" property="productId" />
|
|
|
+ <result column="ladderNum" jdbcType="BIGINT" property="ladderNum" />
|
|
|
+ <result column="buyNum" jdbcType="BIGINT" property="buyNum" />
|
|
|
+ <result column="buyPrice" jdbcType="DECIMAL" property="buyPrice" />
|
|
|
+ <result column="createBy" jdbcType="BIGINT" property="createBy" />
|
|
|
+ <result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
|
|
|
+ <result column="updateBy" jdbcType="BIGINT" property="updateBy" />
|
|
|
+ <result column="updateDate" jdbcType="TIMESTAMP" property="updateDate" />
|
|
|
+ <result column="delFlag" jdbcType="CHAR" property="delFlag" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, productId, ladderNum, buyNum, buyPrice, createBy, createDate, updateBy, updateDate,
|
|
|
+ delFlag
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from cm_mall_product_ladder_price
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <select id="selectByProductId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from cm_mall_product_ladder_price
|
|
|
+ where productId = #{productId,jdbcType=BIGINT}
|
|
|
+ order by ladderNum
|
|
|
+ </select>
|
|
|
+ <select id="selectIdByProductIdAndLadderNum" parameterType="java.lang.Long" resultType="java.lang.Long">
|
|
|
+ select id
|
|
|
+ from cm_mall_product_ladder_price
|
|
|
+ where productId = #{productId,jdbcType=BIGINT}
|
|
|
+ and ladderNum = #{ladderNum,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete from cm_mall_product_ladder_price
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.caimei.modules.products.entity.CmMallProductLadderPrice" useGeneratedKeys="true">
|
|
|
+ insert into cm_mall_product_ladder_price (productId, ladderNum, buyNum,
|
|
|
+ buyPrice, createBy, createDate,
|
|
|
+ updateBy, updateDate, delFlag
|
|
|
+ )
|
|
|
+ values (#{productId,jdbcType=BIGINT}, #{ladderNum,jdbcType=BIGINT}, #{buyNum,jdbcType=BIGINT},
|
|
|
+ #{buyPrice,jdbcType=DECIMAL}, #{createBy,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ #{updateBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.caimei.modules.products.entity.CmMallProductLadderPrice" useGeneratedKeys="true">
|
|
|
+ insert into cm_mall_product_ladder_price
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productId != null">
|
|
|
+ productId,
|
|
|
+ </if>
|
|
|
+ <if test="ladderNum != null">
|
|
|
+ ladderNum,
|
|
|
+ </if>
|
|
|
+ <if test="buyNum != null">
|
|
|
+ buyNum,
|
|
|
+ </if>
|
|
|
+ <if test="buyPrice != null">
|
|
|
+ buyPrice,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ createBy,
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ createDate,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ updateBy,
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ updateDate,
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ delFlag,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="productId != null">
|
|
|
+ #{productId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="ladderNum != null">
|
|
|
+ #{ladderNum,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="buyNum != null">
|
|
|
+ #{buyNum,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="buyPrice != null">
|
|
|
+ #{buyPrice,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ #{updateDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.caimei.modules.products.entity.CmMallProductLadderPrice">
|
|
|
+ update cm_mall_product_ladder_price
|
|
|
+ <set>
|
|
|
+ <if test="productId != null">
|
|
|
+ productId = #{productId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="ladderNum != null">
|
|
|
+ ladderNum = #{ladderNum,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="buyNum != null">
|
|
|
+ buyNum = #{buyNum,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="buyPrice != null">
|
|
|
+ buyPrice = #{buyPrice,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ createBy = #{createBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createDate != null">
|
|
|
+ createDate = #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ updateBy = #{updateBy,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="updateDate != null">
|
|
|
+ updateDate = #{updateDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ delFlag = #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.caimei.modules.products.entity.CmMallProductLadderPrice">
|
|
|
+ update cm_mall_product_ladder_price
|
|
|
+ set productId = #{productId,jdbcType=BIGINT},
|
|
|
+ ladderNum = #{ladderNum,jdbcType=BIGINT},
|
|
|
+ buyNum = #{buyNum,jdbcType=BIGINT},
|
|
|
+ buyPrice = #{buyPrice,jdbcType=DECIMAL},
|
|
|
+ createBy = #{createBy,jdbcType=BIGINT},
|
|
|
+ createDate = #{createDate,jdbcType=TIMESTAMP},
|
|
|
+ updateBy = #{updateBy,jdbcType=BIGINT},
|
|
|
+ updateDate = #{updateDate,jdbcType=TIMESTAMP},
|
|
|
+ delFlag = #{delFlag,jdbcType=CHAR}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+</mapper>
|