|
@@ -1,161 +1,158 @@
|
|
|
-<?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.api.dao.ApiStoreMngChangeMapper" >
|
|
|
- <resultMap id="BaseResultMap" type="com.kmall.api.entity.MallStoreMngChange" >
|
|
|
- <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="store_change_num" property="storeChangeNum" jdbcType="INTEGER" />
|
|
|
- <result column="store_original_num" property="storeOriginalNum" jdbcType="INTEGER" />
|
|
|
- <result column="store_valid_num" property="storeValidNum" jdbcType="INTEGER" />
|
|
|
- <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
|
|
|
- <result column="store_id" property="storeId" jdbcType="INTEGER" />
|
|
|
- <result column="sku" property="sku" jdbcType="VARCHAR" />
|
|
|
- <result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
|
|
- <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
|
|
|
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
|
|
|
- <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List" >
|
|
|
- id, store_change_num, store_original_num, store_valid_num, merch_sn, store_id, sku,
|
|
|
- is_valid, creater_sn, create_time, moder_sn, mod_time, tstm
|
|
|
- </sql>
|
|
|
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from mall_store_mng_change
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
- <delete id="delete" parameterType="java.lang.Integer" >
|
|
|
- delete from mall_store_mng_change
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
- <insert id="save" parameterType="com.kmall.api.entity.MallStoreMngChange" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into mall_store_mng_change
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="id != null" >
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="storeChangeNum != null" >
|
|
|
- store_change_num,
|
|
|
- </if>
|
|
|
- <if test="storeOriginalNum != null" >
|
|
|
- store_original_num,
|
|
|
- </if>
|
|
|
- <if test="storeValidNum != null" >
|
|
|
- store_valid_num,
|
|
|
- </if>
|
|
|
- <if test="merchSn != null" >
|
|
|
- merch_sn,
|
|
|
- </if>
|
|
|
- <if test="storeId != null" >
|
|
|
- store_id,
|
|
|
- </if>
|
|
|
- <if test="sku != null" >
|
|
|
- sku,
|
|
|
- </if>
|
|
|
- <if test="isValid != null" >
|
|
|
- is_valid,
|
|
|
- </if>
|
|
|
- <if test="createrSn != null" >
|
|
|
- creater_sn,
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="moderSn != null" >
|
|
|
- moder_sn,
|
|
|
- </if>
|
|
|
- <if test="modTime != null" >
|
|
|
- mod_time,
|
|
|
- </if>
|
|
|
- <if test="tstm != null" >
|
|
|
- tstm,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="id != null" >
|
|
|
- #{id,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="storeChangeNum != null" >
|
|
|
- #{storeChangeNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="storeOriginalNum != null" >
|
|
|
- #{storeOriginalNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="storeValidNum != null" >
|
|
|
- #{storeValidNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="merchSn != null" >
|
|
|
- #{merchSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="storeId != null" >
|
|
|
- #{storeId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="sku != null" >
|
|
|
- #{sku,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="isValid != null" >
|
|
|
- #{isValid,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createrSn != null" >
|
|
|
- #{createrSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="moderSn != null" >
|
|
|
- #{moderSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="modTime != null" >
|
|
|
- #{modTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="tstm != null" >
|
|
|
- #{tstm,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
+<?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.api.dao.ApiStoreMngChangeMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.kmall.api.entity.StoreMngChangeVo" id="storeMngChangeMap">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="storeChangeNum" column="store_change_num"/>
|
|
|
+ <result property="storeOriginalNum" column="store_original_num"/>
|
|
|
+ <result property="storeValidNum" column="store_valid_num"/>
|
|
|
+ <result property="merchSn" column="merch_sn"/>
|
|
|
+ <result property="storeId" column="store_id"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <result property="isValid" column="is_valid"/>
|
|
|
+ <result property="changeType" column="change_type"/>
|
|
|
+ <result property="changeReason" column="change_reason"/>
|
|
|
+ <result property="createrSn" column="creater_sn"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="moderSn" column="moder_sn"/>
|
|
|
+ <result property="modTime" column="mod_time"/>
|
|
|
+ <result property="tstm" column="tstm"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="queryObject" resultType="com.kmall.api.entity.StoreMngChangeVo">
|
|
|
+ select
|
|
|
+ `id`,
|
|
|
+ `store_change_num`,
|
|
|
+ `store_original_num`,
|
|
|
+ `store_valid_num`,
|
|
|
+ `merch_sn`,
|
|
|
+ `store_id`,
|
|
|
+ `goods_id`,
|
|
|
+ `is_valid`,
|
|
|
+ `change_type`,
|
|
|
+ `change_reason`,
|
|
|
+ `creater_sn`,
|
|
|
+ `create_time`,
|
|
|
+ `moder_sn`,
|
|
|
+ `mod_time`,
|
|
|
+ `tstm`
|
|
|
+ from mall_store_mng_change
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="queryList" resultType="com.kmall.api.entity.StoreMngChangeVo">
|
|
|
+ select
|
|
|
+ `id`,
|
|
|
+ `store_change_num`,
|
|
|
+ `store_original_num`,
|
|
|
+ `store_valid_num`,
|
|
|
+ `merch_sn`,
|
|
|
+ `store_id`,
|
|
|
+ `goods_id`,
|
|
|
+ `is_valid`,
|
|
|
+ `change_type`,
|
|
|
+ `change_reason`,
|
|
|
+ `creater_sn`,
|
|
|
+ `create_time`,
|
|
|
+ `moder_sn`,
|
|
|
+ `mod_time`,
|
|
|
+ `tstm`
|
|
|
+ from mall_store_mng_change c left join mall_merch m on c.merch_sn = m.merch_sn
|
|
|
+ left join mall_store s on s.id = c.store_id
|
|
|
+ left join mall_goods g on c.goods_id = g.id
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="goodsId != null and goodsId != ''">
|
|
|
+ AND c.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="storeId != null and storeId != ''">
|
|
|
+ AND c.store_id = #{storeId}
|
|
|
+ </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_store_mng_change
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="name != null and name.trim() != ''">
|
|
|
+ AND name LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="save" parameterType="com.kmall.api.entity.StoreMngChangeVo">
|
|
|
+ insert into mall_store_mng_change(
|
|
|
+ `store_change_num`,
|
|
|
+ `store_original_num`,
|
|
|
+ `store_valid_num`,
|
|
|
+ `merch_sn`,
|
|
|
+ `store_id`,
|
|
|
+ `goods_id`,
|
|
|
+ `is_valid`,
|
|
|
+ `change_type`,
|
|
|
+ `change_reason`,
|
|
|
+ `creater_sn`,
|
|
|
+ `create_time`,
|
|
|
+ `moder_sn`,
|
|
|
+ `mod_time`,
|
|
|
+ `tstm`)
|
|
|
+ values(
|
|
|
+ #{storeChangeNum},
|
|
|
+ #{storeOriginalNum},
|
|
|
+ #{storeValidNum},
|
|
|
+ #{merchSn},
|
|
|
+ #{storeId},
|
|
|
+ #{goodsId},
|
|
|
+ #{isValid},
|
|
|
+ #{changeType},
|
|
|
+ #{changeReason},
|
|
|
+ #{createrSn},
|
|
|
+ #{createTime},
|
|
|
+ #{moderSn},
|
|
|
+ #{modTime},
|
|
|
+ #{tstm})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.kmall.api.entity.StoreMngChangeVo">
|
|
|
+ update mall_store_mng_change
|
|
|
+ <set>
|
|
|
+ <if test="storeChangeNum != null">`store_change_num` = #{storeChangeNum}, </if>
|
|
|
+ <if test="storeOriginalNum != null">`store_original_num` = #{storeOriginalNum}, </if>
|
|
|
+ <if test="storeValidNum != null">`store_valid_num` = #{storeValidNum}, </if>
|
|
|
+ <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
|
|
|
+ <if test="storeId != null">`store_id` = #{storeId}, </if>
|
|
|
+ <if test="goodsId != null">`goods_id` = #{goodsId}, </if>
|
|
|
+ <if test="isValid != null">`is_valid` = #{isValid}, </if>
|
|
|
+ <if test="changeType != null">`change_type` = #{changeType}, </if>
|
|
|
+ <if test="changeReason != null">`change_reason` = #{changeReason}, </if>
|
|
|
+ <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
|
|
|
+ <if test="createTime != null">`create_time` = #{createTime}, </if>
|
|
|
+ <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
|
|
|
+ <if test="modTime != null">`mod_time` = #{modTime}, </if>
|
|
|
+ <if test="tstm != null">`tstm` = #{tstm}</if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ delete from mall_store_mng_change where id = #{value}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteBatch">
|
|
|
+ delete from mall_store_mng_change where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
|
|
|
- <update id="update" parameterType="com.kmall.api.entity.MallStoreMngChange" >
|
|
|
- update mall_store_mng_change
|
|
|
- <set >
|
|
|
- <if test="storeChangeNum != null" >
|
|
|
- store_change_num = #{storeChangeNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="storeOriginalNum != null" >
|
|
|
- store_original_num = #{storeOriginalNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="storeValidNum != null" >
|
|
|
- store_valid_num = #{storeValidNum,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="merchSn != null" >
|
|
|
- merch_sn = #{merchSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="storeId != null" >
|
|
|
- store_id = #{storeId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="sku != null" >
|
|
|
- sku = #{sku,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="isValid != null" >
|
|
|
- is_valid = #{isValid,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createrSn != null" >
|
|
|
- creater_sn = #{createrSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="moderSn != null" >
|
|
|
- moder_sn = #{moderSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="modTime != null" >
|
|
|
- mod_time = #{modTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="tstm != null" >
|
|
|
- tstm = #{tstm,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
</mapper>
|