...
|
...
|
@@ -27,127 +27,47 @@ |
|
|
delete from product_self_shelves
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.yoho.product.model.ProductSelfShelves" >
|
|
|
insert into product_self_shelves (id, brand, product_name,
|
|
|
price, sale_time, product_code,
|
|
|
status, uid, create_time,
|
|
|
update_time)
|
|
|
values (#{id,jdbcType=INTEGER}, #{brand,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR},
|
|
|
#{price,jdbcType=DECIMAL}, #{saleTime,jdbcType=INTEGER}, #{productCode,jdbcType=VARCHAR},
|
|
|
#{status,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
|
|
|
#{updateTime,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.yoho.product.model.ProductSelfShelves" >
|
|
|
insert into product_self_shelves
|
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
id,
|
|
|
</if>
|
|
|
<if test="brand != null" >
|
|
|
brand,
|
|
|
</if>
|
|
|
<if test="productName != null" >
|
|
|
product_name,
|
|
|
</if>
|
|
|
<if test="price != null" >
|
|
|
price,
|
|
|
</if>
|
|
|
<if test="saleTime != null" >
|
|
|
sale_time,
|
|
|
</if>
|
|
|
<if test="productCode != null" >
|
|
|
product_code,
|
|
|
</if>
|
|
|
<if test="status != null" >
|
|
|
status,
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
uid,
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time,
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
update_time,
|
|
|
</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
<if test="id != null" >
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="brand != null" >
|
|
|
#{brand,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="productName != null" >
|
|
|
#{productName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="price != null" >
|
|
|
#{price,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="saleTime != null" >
|
|
|
#{saleTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="productCode != null" >
|
|
|
#{productCode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="status != null" >
|
|
|
#{status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
#{uid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
#{createTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
#{updateTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.product.model.ProductSelfShelves" >
|
|
|
update product_self_shelves
|
|
|
<set >
|
|
|
<if test="brand != null" >
|
|
|
brand = #{brand,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="productName != null" >
|
|
|
product_name = #{productName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="price != null" >
|
|
|
price = #{price,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="saleTime != null" >
|
|
|
sale_time = #{saleTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="productCode != null" >
|
|
|
product_code = #{productCode,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="status != null" >
|
|
|
status = #{status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="uid != null" >
|
|
|
uid = #{uid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createTime != null" >
|
|
|
create_time = #{createTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="updateTime != null" >
|
|
|
update_time = #{updateTime,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.yoho.product.model.ProductSelfShelves" >
|
|
|
update product_self_shelves
|
|
|
set brand = #{brand,jdbcType=VARCHAR},
|
|
|
product_name = #{productName,jdbcType=VARCHAR},
|
|
|
price = #{price,jdbcType=DECIMAL},
|
|
|
sale_time = #{saleTime,jdbcType=INTEGER},
|
|
|
product_code = #{productCode,jdbcType=VARCHAR},
|
|
|
status = #{status,jdbcType=INTEGER},
|
|
|
uid = #{uid,jdbcType=INTEGER},
|
|
|
create_time = #{createTime,jdbcType=INTEGER},
|
|
|
update_time = #{updateTime,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<sql id="Query_Sql" >
|
|
|
<if test="selfShelvesReq.productName != null and selfShelvesReq.productName != '' ">
|
|
|
<bind name="pattern" value="'%' + selfShelvesReq.productName + '%'" />
|
|
|
and product_name like #{pattern}
|
|
|
</if>
|
|
|
<if test="selfShelvesReq.productCode != null and selfShelvesReq.productName != '' ">
|
|
|
and product_code=#{selfShelvesReq.productCode}
|
|
|
</if>
|
|
|
<if test="selfShelvesReq.status != null">
|
|
|
and status=#{selfShelvesReq.status}
|
|
|
</if>
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.product.model.SelfShelvesReq">
|
|
|
select count(1)
|
|
|
from product_self_shelves
|
|
|
where 1=1
|
|
|
<include refid="Query_Sql"></include>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.product.model.SelfShelvesReq">
|
|
|
select <include refid="Base_Column_List"></include>
|
|
|
from product_self_shelves
|
|
|
where 1=1
|
|
|
<include refid="Query_Sql"></include>
|
|
|
order by update_time desc
|
|
|
<if test="selfShelvesReq.start!=null and selfShelvesReq.size != null">
|
|
|
limit #{selfShelvesReq.start},#{selfShelvesReq.size}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
|
select <include refid="Base_Column_List"></include>
|
|
|
from product_self_shelves
|
|
|
where id=#{id}
|
|
|
</select>
|
|
|
|
|
|
<update id="upadteAuditResult">
|
|
|
update product_self_shelves set status=#{status}, update_time=unix_timestamp()
|
|
|
where id=#{id}
|
|
|
</update>
|
|
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|