|
|
@@ -0,0 +1,248 @@
|
|
|
+<?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.usoftchina.saas.storage.mapper.StockTakingMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.StockTaking">
|
|
|
+ <id column="st_id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="st_prodid" jdbcType="INTEGER" property="st_prodid" />
|
|
|
+ <result column="st_prodcode" jdbcType="VARCHAR" property="st_prodcode" />
|
|
|
+ <result column="st_proddetail" jdbcType="VARCHAR" property="st_proddetail" />
|
|
|
+ <result column="st_prodorispeccode" jdbcType="VARCHAR" property="st_prodorispeccode" />
|
|
|
+ <result column="st_prodkind" jdbcType="VARCHAR" property="st_prodkind" />
|
|
|
+ <result column="st_produnit" jdbcType="VARCHAR" property="st_produnit" />
|
|
|
+ <result column="st_whid" jdbcType="INTEGER" property="st_whid" />
|
|
|
+ <result column="st_whcode" jdbcType="VARCHAR" property="st_whcode" />
|
|
|
+ <result column="st_whname" jdbcType="VARCHAR" property="st_whname" />
|
|
|
+ <result column="st_batchqty" jdbcType="DOUBLE" property="st_batchqty" />
|
|
|
+ <result column="st_actqty" jdbcType="DOUBLE" property="st_actqty" />
|
|
|
+ <result column="st_num" jdbcType="DOUBLE" property="st_num" />
|
|
|
+ <result column="companyId" jdbcType="INTEGER" property="companyId" />
|
|
|
+ <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
|
|
|
+ <result column="creatorId" jdbcType="INTEGER" property="creatorId" />
|
|
|
+ <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="updaterName" jdbcType="TIMESTAMP" property="updaterName" />
|
|
|
+ <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ st_id, st_prodid, st_prodcode, st_proddetail, st_prodorispeccode, st_prodkind, st_produnit,
|
|
|
+ st_whid, st_whcode, st_whname, st_batchqty, st_actqty, st_num, companyId, createTime,
|
|
|
+ creatorName, creatorId, updateTime, updaterName, updaterId
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from stocktaking
|
|
|
+ where st_id = #{st_id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from stocktaking
|
|
|
+ where st_id = #{st_id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.StockTaking">
|
|
|
+ <selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
+ SELECT LAST_INSERT_ID() AS ID
|
|
|
+ </selectKey>
|
|
|
+ insert into stocktaking
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+
|
|
|
+ <if test="st_prodid != null">
|
|
|
+ st_prodid,
|
|
|
+ </if>
|
|
|
+ <if test="st_prodcode != null">
|
|
|
+ st_prodcode,
|
|
|
+ </if>
|
|
|
+ <if test="st_proddetail != null">
|
|
|
+ st_proddetail,
|
|
|
+ </if>
|
|
|
+ <if test="st_prodorispeccode != null">
|
|
|
+ st_prodorispeccode,
|
|
|
+ </if>
|
|
|
+ <if test="st_prodkind != null">
|
|
|
+ st_prodkind,
|
|
|
+ </if>
|
|
|
+ <if test="st_produnit != null">
|
|
|
+ st_produnit,
|
|
|
+ </if>
|
|
|
+ <if test="st_whid != null">
|
|
|
+ st_whid,
|
|
|
+ </if>
|
|
|
+ <if test="st_whcode != null">
|
|
|
+ st_whcode,
|
|
|
+ </if>
|
|
|
+ <if test="st_whname != null">
|
|
|
+ st_whname,
|
|
|
+ </if>
|
|
|
+ <if test="st_batchqty != null">
|
|
|
+ st_batchqty,
|
|
|
+ </if>
|
|
|
+ <if test="st_actqty != null">
|
|
|
+ st_actqty,
|
|
|
+ </if>
|
|
|
+ <if test="st_num != null">
|
|
|
+ st_num,
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ companyId,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ createTime,
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null">
|
|
|
+ creatorName,
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null">
|
|
|
+ creatorId,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null">
|
|
|
+ updaterName,
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+
|
|
|
+ <if test="st_prodid != null">
|
|
|
+ #{st_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodcode != null">
|
|
|
+ #{st_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_proddetail != null">
|
|
|
+ #{st_proddetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodorispeccode != null">
|
|
|
+ #{st_prodorispeccode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodkind != null">
|
|
|
+ #{st_prodkind,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_produnit != null">
|
|
|
+ #{st_produnit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_whid != null">
|
|
|
+ #{st_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="st_whcode != null">
|
|
|
+ #{st_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_whname != null">
|
|
|
+ #{st_whname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_batchqty != null">
|
|
|
+ #{st_batchqty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="st_actqty != null">
|
|
|
+ #{st_actqty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="st_num != null">
|
|
|
+ #{st_num,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null">
|
|
|
+ #{creatorName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null">
|
|
|
+ #{creatorId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null">
|
|
|
+ #{updaterName,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.StockTaking">
|
|
|
+ update stocktaking
|
|
|
+ <set>
|
|
|
+ <if test="st_prodid != null">
|
|
|
+ st_prodid = #{st_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodcode != null">
|
|
|
+ st_prodcode = #{st_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_proddetail != null">
|
|
|
+ st_proddetail = #{st_proddetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodorispeccode != null">
|
|
|
+ st_prodorispeccode = #{st_prodorispeccode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_prodkind != null">
|
|
|
+ st_prodkind = #{st_prodkind,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_produnit != null">
|
|
|
+ st_produnit = #{st_produnit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_whid != null">
|
|
|
+ st_whid = #{st_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="st_whcode != null">
|
|
|
+ st_whcode = #{st_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_whname != null">
|
|
|
+ st_whname = #{st_whname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_batchqty != null">
|
|
|
+ st_batchqty = #{st_batchqty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="st_actqty != null">
|
|
|
+ st_actqty = #{st_actqty,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="st_num != null">
|
|
|
+ st_num = #{st_num,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ createTime = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="creatorName != null">
|
|
|
+ creatorName = #{creatorName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creatorId != null">
|
|
|
+ creatorId = #{creatorId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterName != null">
|
|
|
+ updaterName = #{updaterName,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where st_id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectStockTakingBycondition" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from stocktaking
|
|
|
+ <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ and companyId = #{companyId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by st_id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|