| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- <?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.document.mapper.WarehouseMapper">
- <resultMap id="WarehouseResultMapper" type="com.usoftchina.saas.document.entities.Warehouse">
- <id column="wh_id" property="id" jdbcType="INTEGER" />
- <result column="wh_code" property="wh_code" jdbcType="VARCHAR" />
- <result column="wh_type" property="wh_type" jdbcType="VARCHAR" />
- <result column="wh_description" property="wh_description" jdbcType="VARCHAR" />
- <result column="wh_statuscode" property="wh_statuscode" jdbcType="VARCHAR" />
- <result column="wh_status" property="wh_status" jdbcType="TIMESTAMP" />
- <result column="wh_recordid" property="wh_recordid" jdbcType="INTEGER" />
- <result column="wh_recorder" property="wh_recorder" jdbcType="INTEGER" />
- <result column="wh_date" property="wh_date" jdbcType="INTEGER" />
- <result column="companyid" property="companyId" jdbcType="INTEGER" />
- <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
- <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="wh_text1" property="wh_text1" jdbcType="VARCHAR" />
- <result column="wh_text2" property="wh_text2" jdbcType="VARCHAR" />
- <result column="wh_text3" property="wh_text3" jdbcType="VARCHAR" />
- <result column="wh_text4" property="wh_text4" jdbcType="VARCHAR" />
- <result column="wh_text5" property="wh_text5" jdbcType="VARCHAR" />
- </resultMap>
- <select id="post" parameterMap="postParamMap" statementType="CALLABLE">
- CALL SP_COMMITPRODINOUT(?, ?, ?, ?, ?)
- </select>
- <select id="unPost" parameterMap="postParamMap" statementType="CALLABLE">
- CALL SP_UNCOMMITPRODINOUT(?, ?, ?, ?, ?)
- </select>
- <parameterMap id="postParamMap" type="java.util.Map">
- <parameter property="inoutNo" jdbcType="VARCHAR" mode="IN" />
- <parameter property="class" jdbcType="VARCHAR" mode="IN" />
- <parameter property="commitid" jdbcType="INTEGER" mode="IN" />
- <parameter property="companyid" jdbcType="INTEGER" mode="IN" />
- <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
- </parameterMap>
- <select id="validPeriod" parameterType="map" resultType="java.lang.Short">
- SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
- </select>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
- wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
- wh_text4, wh_text5
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="WarehouseResultMapper">
- select
- <include refid="Base_Column_List" />
- from warehouse
- where wh_id = #{wh_id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from warehouse
- where wh_id = #{wh_id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
- insert into warehouse (wh_id, wh_code, wh_type,
- wh_description, wh_statuscode, wh_status,
- wh_recorderid, wh_recorder, wh_date,
- companyid, updaterId, updatetime,
- wh_text1, wh_text2, wh_text3,
- wh_text4, wh_text5)
- values (#{wh_id,jdbcType=INTEGER}, #{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
- #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
- #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
- #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
- #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
- #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
- insert into warehouse
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wh_id != null">
- wh_id,
- </if>
- <if test="wh_code != null">
- wh_code,
- </if>
- <if test="wh_type != null">
- wh_type,
- </if>
- <if test="wh_description != null">
- wh_description,
- </if>
- <if test="wh_statuscode != null">
- wh_statuscode,
- </if>
- <if test="wh_status != null">
- wh_status,
- </if>
- <if test="wh_recorderid != null">
- wh_recorderid,
- </if>
- <if test="wh_recorder != null">
- wh_recorder,
- </if>
- <if test="wh_date != null">
- wh_date,
- </if>
- <if test="companyid != null">
- companyid,
- </if>
- <if test="updaterId != null">
- updaterId,
- </if>
- <if test="updatetime != null">
- updatetime,
- </if>
- <if test="wh_text1 != null">
- wh_text1,
- </if>
- <if test="wh_text2 != null">
- wh_text2,
- </if>
- <if test="wh_text3 != null">
- wh_text3,
- </if>
- <if test="wh_text4 != null">
- wh_text4,
- </if>
- <if test="wh_text5 != null">
- wh_text5,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="wh_id != null">
- #{wh_id,jdbcType=INTEGER},
- </if>
- <if test="wh_code != null">
- #{wh_code,jdbcType=VARCHAR},
- </if>
- <if test="wh_type != null">
- #{wh_type,jdbcType=VARCHAR},
- </if>
- <if test="wh_description != null">
- #{wh_description,jdbcType=VARCHAR},
- </if>
- <if test="wh_statuscode != null">
- #{wh_statuscode,jdbcType=VARCHAR},
- </if>
- <if test="wh_status != null">
- #{wh_status,jdbcType=VARCHAR},
- </if>
- <if test="wh_recorderid != null">
- #{wh_recorderid,jdbcType=VARCHAR},
- </if>
- <if test="wh_recorder != null">
- #{wh_recorder,jdbcType=VARCHAR},
- </if>
- <if test="wh_date != null">
- #{wh_date,jdbcType=TIMESTAMP},
- </if>
- <if test="companyid != null">
- #{companyid,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null">
- #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updatetime != null">
- #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="wh_text1 != null">
- #{wh_text1,jdbcType=VARCHAR},
- </if>
- <if test="wh_text2 != null">
- #{wh_text2,jdbcType=VARCHAR},
- </if>
- <if test="wh_text3 != null">
- #{wh_text3,jdbcType=VARCHAR},
- </if>
- <if test="wh_text4 != null">
- #{wh_text4,jdbcType=VARCHAR},
- </if>
- <if test="wh_text5 != null">
- #{wh_text5,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
- update warehouse
- <set>
- <if test="wh_code != null">
- wh_code = #{wh_code,jdbcType=VARCHAR},
- </if>
- <if test="wh_type != null">
- wh_type = #{wh_type,jdbcType=VARCHAR},
- </if>
- <if test="wh_description != null">
- wh_description = #{wh_description,jdbcType=VARCHAR},
- </if>
- <if test="wh_statuscode != null">
- wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
- </if>
- <if test="wh_status != null">
- wh_status = #{wh_status,jdbcType=VARCHAR},
- </if>
- <if test="wh_recorderid != null">
- wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
- </if>
- <if test="wh_recorder != null">
- wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
- </if>
- <if test="wh_date != null">
- wh_date = #{wh_date,jdbcType=TIMESTAMP},
- </if>
- <if test="companyid != null">
- companyid = #{companyid,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null">
- updaterId = #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updatetime != null">
- updatetime = #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="wh_text1 != null">
- wh_text1 = #{wh_text1,jdbcType=VARCHAR},
- </if>
- <if test="wh_text2 != null">
- wh_text2 = #{wh_text2,jdbcType=VARCHAR},
- </if>
- <if test="wh_text3 != null">
- wh_text3 = #{wh_text3,jdbcType=VARCHAR},
- </if>
- <if test="wh_text4 != null">
- wh_text4 = #{wh_text4,jdbcType=VARCHAR},
- </if>
- <if test="wh_text5 != null">
- wh_text5 = #{wh_text5,jdbcType=VARCHAR},
- </if>
- </set>
- where wh_id = #{wh_id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
- update warehouse
- set wh_code = #{wh_code,jdbcType=VARCHAR},
- wh_type = #{wh_type,jdbcType=VARCHAR},
- wh_description = #{wh_description,jdbcType=VARCHAR},
- wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
- wh_status = #{wh_status,jdbcType=VARCHAR},
- wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
- wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
- wh_date = #{wh_date,jdbcType=TIMESTAMP},
- companyid = #{companyid,jdbcType=INTEGER},
- updaterId = #{updaterId,jdbcType=INTEGER},
- updatetime = #{updatetime,jdbcType=TIMESTAMP},
- wh_text1 = #{wh_text1,jdbcType=VARCHAR},
- wh_text2 = #{wh_text2,jdbcType=VARCHAR},
- wh_text3 = #{wh_text3,jdbcType=VARCHAR},
- wh_text4 = #{wh_text4,jdbcType=VARCHAR},
- wh_text5 = #{wh_text5,jdbcType=VARCHAR}
- where wh_id = #{wh_id,jdbcType=INTEGER}
- </update>
- <select id="selectAll" resultType="com.usoftchina.saas.document.entities.Warehouse">
- SELECT * FROM WAREHOUSE WHERE COMPANYID = #{companyId}
- </select>
- <select id="validateCodeWhenInsert" resultType="int">
- select count(*) from WAREHOUSE where WH_CODE = #{code} and companyId =#{companyId}
- </select>
- <select id="validateCodeWhenUpdate" resultType="int" >
- select count(*) from WAREHOUSE where WH_CODE = #{code} and WH_ID != #{id} and companyId =#{companyId}
- </select>
- </mapper>
|