123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?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
- `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 1=1
- <if test="name != null and name.trim() != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by 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 = #{type}
- where id in
- <foreach collection="array" item="item" open="(" separator="," close=")">
- #{item}
- </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>
|