123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?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.kmall.admin.dao.haikong.StockChangeDao">
- <resultMap type="com.kmall.admin.entity.haikong.StockChangeEntity" id="stockChangeMap">
- <result property="id" column="id"/>
- <result property="type" column="type"/>
- <result property="time" column="time"/>
- <result property="merchSn" column="merch_sn"/>
- <result property="merch" column="merch"/>
- <result property="storeId" column="store_id"/>
- <result property="store" column="store"/>
- <result property="thirdMerchSn" column="third_merch_sn"/>
- <result property="audit" column="audit"/>
- <result property="thirdMerch" column="third_merch"/>
- <result property="remark" column="remark"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="modifyBy" column="modify_by"/>
- <result property="modifyTime" column="modify_time"/>
- <result property="auditBy" column="audit_by"/>
- <result property="auditTime" column="audit_time"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
- select
- `id`,
- `type`,
- `time`,
- `merch_sn`,
- `merch`,
- `store_id`,
- `store`,
- `third_merch_sn`,
- `audit`,
- `third_merch`,
- `remark`,
- `create_by`,
- `create_time`,
- `modify_by`,
- `modify_time`,
- `audit_by`,
- `audit_time`
- from mall_stock_change
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
- select
- c.`id`,
- c.`type`,
- c.`time`,
- c.`merch_sn`,
- c.`merch`,
- c.`store_id`,
- c.`store`,
- c.`third_merch_sn`,
- c.`audit`,
- c.`third_merch`,
- c.`remark`,
- c.`create_by`,
- c.`create_time`,
- c.`modify_by`,
- c.`modify_time`,
- c.`audit_by`,
- c.`audit_time`,
- r.product,
- r.specification
- from mall_stock_change c
- left join mall_stock_change_record r
- on c.id =r.parent_id
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND c.name LIKE concat('%',#{name},'%')
- </if>
- <if test="orderId != null and orderId.trim() != ''">
- AND c.id = #{orderId}
- </if>
- <if test="type != null and type.trim() != ''">
- AND c.type = #{type}
- </if>
- <if test="time != null and time.trim() != ''">
- AND c.time > #{time}
- </if>
- <if test="audit != null and audit.trim() != ''">
- AND c.audit = #{audit}
- </if>
- <if test="storeId != null and storeId.trim() != ''">
- AND c.store_id = #{storeId}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by c.id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
-
- <select id="queryTotal" resultType="int">
- select count(*) from mall_stock_change
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- </select>
- <select id="queryListByIds" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
- select * from mall_stock_change
- where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.haikong.StockChangeEntity">
- insert into mall_stock_change(
- `id`,
- `type`,
- `time`,
- `merch_sn`,
- `merch`,
- `store_id`,
- `store`,
- `third_merch_sn`,
- `audit`,
- `third_merch`,
- `remark`,
- `create_by`,
- `create_time`,
- `modify_by`,
- `modify_time`,
- `audit_by`,
- `audit_time`)
- values(
- #{id},
- #{type},
- #{time},
- #{merchSn},
- #{merch},
- #{storeId},
- #{store},
- #{thirdMerchSn},
- #{audit},
- #{thirdMerch},
- #{remark},
- #{createBy},
- #{createTime},
- #{modifyBy},
- #{modifyTime},
- #{auditBy},
- #{auditTime})
- </insert>
-
- <update id="update" parameterType="com.kmall.admin.entity.haikong.StockChangeEntity">
- update mall_stock_change
- <set>
- <if test="type != null">`type` = #{type}, </if>
- <if test="time != null">`time` = #{time}, </if>
- <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
- <if test="merch != null">`merch` = #{merch}, </if>
- <if test="storeId != null">`store_id` = #{storeId}, </if>
- <if test="store != null">`store` = #{store}, </if>
- <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
- <if test="audit != null">`audit` = #{audit}, </if>
- <if test="thirdMerch != null">`third_merch` = #{thirdMerch}, </if>
- <if test="remark != null">`remark` = #{remark}, </if>
- <if test="createBy != null">`create_by` = #{createBy}, </if>
- <if test="createTime != null">`create_time` = #{createTime}, </if>
- <if test="modifyBy != null">`modify_by` = #{modifyBy}, </if>
- <if test="modifyTime != null">`modify_time` = #{modifyTime}, </if>
- <if test="auditBy != null">`audit_by` = #{auditBy}, </if>
- <if test="auditTime != null">`audit_time` = #{auditTime}</if>
- </set>
- where id = #{id}
- </update>
- <update id="updateAuditStatus" >
- update mall_stock_change set audit = #{map.type},audit_by =#{map.auditBy},audit_time=#{map.auditTime}
- where id in
- <foreach collection="ids" item="ids" open="(" separator="," close=")">
- #{ids}
- </foreach>
- </update>
- <delete id="delete">
- delete from mall_stock_change where id = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from mall_stock_change where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|