123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- <?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.th.demo.mapping.ware.StoreMapper" >
- <resultMap id="BaseResultMap" type="com.th.demo.model.ware.Store" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="layer" property="layer" jdbcType="INTEGER" />
- <result column="model" property="model" jdbcType="VARCHAR" />
- <result column="plate_no" property="plateNo" jdbcType="VARCHAR" />
- <result column="count" property="count" jdbcType="DOUBLE" />
- <result column="weight" property="weight" jdbcType="DOUBLE" />
- <result column="remark" property="remark" jdbcType="VARCHAR" />
- <result column="add_id" property="addId" jdbcType="VARCHAR" />
- <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
- <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
- <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
- <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
- <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
- <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
- <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
- <result column="in_id" property="inId" jdbcType="VARCHAR" />
- <result column="out_id" property="outId" jdbcType="VARCHAR" />
- <result column="receive_address" property="receiveAddress" jdbcType="VARCHAR" />
- <result column="out_flag" property="outFlag" jdbcType="VARCHAR" />
- <result column="lock_flag" property="lockFlag" jdbcType="VARCHAR" />
-
- <result column="wgt_dcn_mtc_cd" property="wgtDcnMtcCd" jdbcType="VARCHAR" />
- <result column="edge_ty" property="edgeTy" jdbcType="VARCHAR" />
- <result column="production_place" property="productionPlace" jdbcType="VARCHAR" />
- <result column="ord_no" property="ordNo" jdbcType="VARCHAR" />
- <result column="car_no" property="carNo" jdbcType="VARCHAR" />
- <result column="tally_people" property="tallyPeople" jdbcType="VARCHAR" />
- <result column="fk_compony_id" property="fkComponyId" jdbcType="VARCHAR" />
- <result column="pack_no" property="packNo" jdbcType="VARCHAR" />
- <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
- <result column="attrib_01" property="attrib01" jdbcType="VARCHAR" />
- <result column="attrib_02" property="attrib02" jdbcType="VARCHAR" />
- <result column="attrib_03" property="attrib03" jdbcType="VARCHAR" />
- <result column="attrib_04" property="attrib04" jdbcType="VARCHAR" />
- <result column="attrib_05" property="attrib05" jdbcType="VARCHAR" />
- <result column="attrib_06" property="attrib06" jdbcType="VARCHAR" />
- <result column="attrib_07" property="attrib07" jdbcType="VARCHAR" />
- <result column="attrib_08" property="attrib08" jdbcType="VARCHAR" />
- <result column="attrib_09" property="attrib09" jdbcType="VARCHAR" />
- <result column="attrib_10" property="attrib10" jdbcType="VARCHAR" />
- <result column="fk_customer_name" property="fkCustomerName" jdbcType="VARCHAR" />
-
- <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
-
- <result column="keep_day" property="keepDay" jdbcType="DOUBLE" />
- <result column="ord_price" property="ordPrice" jdbcType="DOUBLE" />
- <result column="out_ord_price" property="outOrdPrice" jdbcType="DOUBLE" />
-
- <result column="inware_day" property="inwareDay" jdbcType="DOUBLE" />
- <result column="pay_way" property="payWay" jdbcType="VARCHAR" />
-
- <result column="change_count" property="changeCount" jdbcType="DOUBLE" />
-
-
- <association column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
- <association column="stack_id" property="stack" select="com.th.demo.mapping.maint.StackMapper.selectByPrimaryKey" />
- <association column="material_id" property="material" select="com.th.demo.mapping.maint.MaterialMapper.selectByPrimaryKey" />
- <association column="customer_id" property="customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
- <association column="add_id" property="addUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
- </resultMap>
-
-
-
- <resultMap id="StoreOfWareStack" type="com.th.demo.model.ware.StoreOfWareStack" >
- <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
- <result column="stack_id" property="stackId" jdbcType="VARCHAR" />
- </resultMap>
-
- <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
- <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
- <result column="total_weight" property="totalWeight" jdbcType="DOUBLE" />
- </resultMap>
-
- <sql id="Base_Column_List" >
- id, ware_id, stack_id, layer, material_id, model, plate_no, customer_id, count, weight,
- remark, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time, cancel_flag,
- belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place,
- pack_no,contract_no,attrib_01,attrib_02,attrib_03,attrib_04,attrib_05,attrib_06,attrib_07,attrib_08,attrib_09,attrib_10,
- keep_day,ord_price,out_ord_price,pay_way
- </sql>
-
-
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- *
- from t_ware_store
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from t_ware_store
- where id = #{id,jdbcType=VARCHAR}
- </delete>
-
- <insert id="insert" parameterType="com.th.demo.model.ware.Store" >
-
- <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
- SELECT REPLACE(UUID(),'-','') as id from dual
- </selectKey>
-
- insert into t_ware_store (id, ware_id, stack_id,
- layer, material_id, model,
- plate_no, customer_id, count,
- weight, remark, add_id,
- add_time, modify_id, modify_time,
- cancel_id, cancel_time, cancel_flag,
- belong_id, in_id, out_id,
- receive_address, out_flag, lock_flag
- ,wgt_dcn_mtc_cd,edge_ty,production_place,ord_no
- ,car_no,tally_people,fk_compony_id,invoice_price,
- pack_no,contract_no,attrib_01,attrib_02,attrib_03,
- attrib_04,attrib_05,attrib_06,attrib_07,attrib_08,
- attrib_09,attrib_10,keep_day,ord_price,out_ord_price,pay_way
- )
- values (#{id,jdbcType=VARCHAR}, #{ware.id,jdbcType=VARCHAR}, #{stack.id,jdbcType=VARCHAR},
- #{layer,jdbcType=INTEGER}, #{material.id,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
- #{plateNo,jdbcType=VARCHAR}, #{customer.id,jdbcType=VARCHAR}, #{count,jdbcType=DOUBLE},
- #{weight,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR},
- #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
- #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR},
- #{belongId,jdbcType=VARCHAR}, #{inId,jdbcType=VARCHAR}, #{outId,jdbcType=VARCHAR},
- #{receiveAddress,jdbcType=VARCHAR}, #{outFlag,jdbcType=VARCHAR}, #{lockFlag,jdbcType=VARCHAR}
- ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR}
- ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE},
- #{packNo,jdbcType=VARCHAR},#{contractNo,jdbcType=VARCHAR},#{attrib01,jdbcType=VARCHAR},#{attrib02,jdbcType=VARCHAR},#{attrib03,jdbcType=VARCHAR},
- #{attrib04,jdbcType=VARCHAR},#{attrib05,jdbcType=VARCHAR},#{attrib06,jdbcType=VARCHAR},#{attrib07,jdbcType=VARCHAR},#{attrib08,jdbcType=VARCHAR},
- #{attrib09,jdbcType=VARCHAR},#{attrib10,jdbcType=VARCHAR},#{keepDay,jdbcType=DOUBLE},#{ordPrice,jdbcType=DOUBLE},#{outOrdPrice,jdbcType=DOUBLE},#{payWay,jdbcType=VARCHAR}
-
- )
- </insert>
-
- <insert id="insertSelective" parameterType="com.th.demo.model.ware.Store" >
- insert into t_ware_store
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="wareName != null" >
- ware_name,
- </if>
- <if test="stackName != null" >
- stack_name,
- </if>
- <if test="layer != null" >
- layer,
- </if>
- <if test="materialName != null" >
- material_name,
- </if>
- <if test="materialNo != null" >
- material_no,
- </if>
- <if test="standard != null" >
- standard,
- </if>
- <if test="model != null" >
- model,
- </if>
- <if test="customerName != null" >
- customer_name,
- </if>
- <if test="customerNo != null" >
- customer_no,
- </if>
- <if test="count != null" >
- count,
- </if>
- <if test="weight != null" >
- weight,
- </if>
- <if test="remark != null" >
- remark,
- </if>
- <if test="addId != null" >
- add_id,
- </if>
- <if test="addTime != null" >
- add_time,
- </if>
- <if test="modifyId != null" >
- modify_id,
- </if>
- <if test="modifyTime != null" >
- modify_time,
- </if>
- <if test="cancelId != null" >
- cancel_id,
- </if>
- <if test="cancelTime != null" >
- cancel_time,
- </if>
- <if test="cancelFlag != null" >
- cancel_flag,
- </if>
- <if test="belongId != null" >
- belong_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="wareName != null" >
- #{wareName,jdbcType=VARCHAR},
- </if>
- <if test="stackName != null" >
- #{stackName,jdbcType=VARCHAR},
- </if>
- <if test="layer != null" >
- #{layer,jdbcType=INTEGER},
- </if>
- <if test="materialName != null" >
- #{materialName,jdbcType=VARCHAR},
- </if>
- <if test="materialNo != null" >
- #{materialNo,jdbcType=VARCHAR},
- </if>
- <if test="standard != null" >
- #{standard,jdbcType=VARCHAR},
- </if>
- <if test="model != null" >
- #{model,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null" >
- #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="customerNo != null" >
- #{customerNo,jdbcType=VARCHAR},
- </if>
- <if test="count != null" >
- #{count,jdbcType=DOUBLE},
- </if>
- <if test="weight != null" >
- #{weight,jdbcType=DOUBLE},
- </if>
- <if test="remark != null" >
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="addId != null" >
- #{addId,jdbcType=VARCHAR},
- </if>
- <if test="addTime != null" >
- #{addTime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyId != null" >
- #{modifyId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null" >
- #{modifyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelId != null" >
- #{cancelId,jdbcType=VARCHAR},
- </if>
- <if test="cancelTime != null" >
- #{cancelTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelFlag != null" >
- #{cancelFlag,jdbcType=VARCHAR},
- </if>
- <if test="belongId != null" >
- #{belongId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.ware.Store" >
- update t_ware_store
- <set >
- <if test="wareName != null" >
- ware_name = #{wareName,jdbcType=VARCHAR},
- </if>
- <if test="stackName != null" >
- stack_name = #{stackName,jdbcType=VARCHAR},
- </if>
- <if test="layer != null" >
- layer = #{layer,jdbcType=INTEGER},
- </if>
- <if test="materialName != null" >
- material_name = #{materialName,jdbcType=VARCHAR},
- </if>
- <if test="materialNo != null" >
- material_no = #{materialNo,jdbcType=VARCHAR},
- </if>
- <if test="standard != null" >
- standard = #{standard,jdbcType=VARCHAR},
- </if>
- <if test="model != null" >
- model = #{model,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null" >
- customer_name = #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="customerNo != null" >
- customer_no = #{customerNo,jdbcType=VARCHAR},
- </if>
- <if test="count != null" >
- count = #{count,jdbcType=DOUBLE},
- </if>
- <if test="weight != null" >
- weight = #{weight,jdbcType=DOUBLE},
- </if>
- <if test="remark != null" >
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="addId != null" >
- add_id = #{addId,jdbcType=VARCHAR},
- </if>
- <if test="addTime != null" >
- add_time = #{addTime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyId != null" >
- modify_id = #{modifyId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null" >
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelId != null" >
- cancel_id = #{cancelId,jdbcType=VARCHAR},
- </if>
- <if test="cancelTime != null" >
- cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelFlag != null" >
- cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
- </if>
- <if test="belongId != null" >
- belong_id = #{belongId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.th.demo.model.ware.Store" >
- update t_ware_store
- set ware_id = #{ware.id,jdbcType=VARCHAR},
- stack_id = #{stack.id,jdbcType=VARCHAR},
- layer = #{layer,jdbcType=INTEGER},
- material_id = #{material.id,jdbcType=VARCHAR},
- model = #{model,jdbcType=VARCHAR},
- plate_no = #{plateNo,jdbcType=VARCHAR},
- customer_id = #{customer.id,jdbcType=VARCHAR},
- count = #{count,jdbcType=DOUBLE},
- weight = #{weight,jdbcType=DOUBLE},
- remark = #{remark,jdbcType=VARCHAR},
- add_id = #{addId,jdbcType=VARCHAR},
- add_time = #{addTime,jdbcType=TIMESTAMP},
- modify_id = #{modifyId,jdbcType=VARCHAR},
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- cancel_id = #{cancelId,jdbcType=VARCHAR},
- cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
- cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
- belong_id = #{belongId,jdbcType=VARCHAR},
- in_id = #{inId,jdbcType=VARCHAR},
- out_id = #{outId,jdbcType=VARCHAR},
- receive_address = #{receiveAddress,jdbcType=VARCHAR},
- out_flag = #{outFlag,jdbcType=VARCHAR},
- lock_flag = #{lockFlag,jdbcType=VARCHAR},
- pack_no = #{packNo,jdbcType=VARCHAR},
- contract_no = #{contractNo,jdbcType=VARCHAR},
- attrib_01 = #{attrib01,jdbcType=VARCHAR},
- attrib_02 = #{attrib02,jdbcType=VARCHAR},
- attrib_03 = #{attrib03,jdbcType=VARCHAR},
- attrib_04 = #{attrib04,jdbcType=VARCHAR},
- attrib_05 = #{attrib05,jdbcType=VARCHAR},
- attrib_06 = #{attrib06,jdbcType=VARCHAR},
- attrib_07 = #{attrib07,jdbcType=VARCHAR},
- attrib_08 = #{attrib08,jdbcType=VARCHAR},
- attrib_09 = #{attrib09,jdbcType=VARCHAR},
- attrib_10 = #{attrib10,jdbcType=VARCHAR},
- keep_day = #{keepDay,jdbcType=DOUBLE},
- ord_price = #{ordPrice,jdbcType=DOUBLE},
- out_ord_price = #{outOrdPrice,jdbcType=DOUBLE},
- pay_way = #{payWay,jdbcType=VARCHAR},
- ord_no= #{ordNo,jdbcType=VARCHAR},
- production_place= #{productionPlace,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <update id="updateFKByPKey" parameterType="com.th.demo.model.ware.Store" >
- update t_ware_store
- set customer_id = #{customer.id,jdbcType=VARCHAR},
- fk_compony_id = #{fkComponyId,jdbcType=VARCHAR},
- receive_address = #{receiveAddress,jdbcType=VARCHAR},
- change_count = #{changeCount,jdbcType=DOUBLE}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
-
-
- <select id="selectLayerByStackId" resultType="java.lang.String" >
- SELECT ifnull(max(t.layer),0) from t_ware_store t
- where t.stack_id =#{param1,jdbcType=VARCHAR}
- and t.belong_id = #{param2,jdbcType=VARCHAR}
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- </select>
-
- <select id="selectByWareIdStackId" resultMap="BaseResultMap" >
- SELECT b.name as fk_compony_id,t.* from t_ware_store t left join t_maint_customer b
- on t.fk_compony_id = b.id
- where t.ware_id = #{param1,jdbcType=VARCHAR}
- and t.stack_id = #{param2,jdbcType=VARCHAR}
- and t.belong_id = #{param3,jdbcType=VARCHAR}
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- order by layer desc
- </select>
-
- <select id="select" resultMap="BaseResultMap" >
-
- select t.* from t_ware_store t where t.ware_name in (
- select b.name from t_maint_userware a ,t_maint_ware b where a.ware_id = b.id
- and user_id = #{param3,jdbcType=VARCHAR} ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- <if test="param1 != ''" >
- and t.ware_name = #{param1,jdbcType=VARCHAR}
- </if>
- <if test="param2 != ''" >
- and t.stack_name = #{param2,jdbcType=VARCHAR}
- </if>
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- order by t.stack_name asc , t.layer desc
-
- </select>
-
-
- <select id="selectForUpDown" resultMap="BaseResultMap" >
- select t.* from t_ware_store t
- where t.ware_id in (
- select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
- ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- and t.ware_id = #{param1,jdbcType=VARCHAR}
- and t.stack_id = #{param2,jdbcType=VARCHAR}
- and t.layer >= #{param5,jdbcType=INTEGER}
- and t.layer <= #{param6,jdbcType=INTEGER}
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- </select>
-
- <update id="updateForUpDownByStep" >
- update t_ware_store t set t.layer = t.layer + #{param7,jdbcType=INTEGER}
- where t.ware_id in (
- select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
- ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- and t.ware_id = #{param1,jdbcType=VARCHAR}
- and t.stack_id = #{param2,jdbcType=VARCHAR}
- and t.layer >= #{param5,jdbcType=INTEGER}
- and t.layer <= #{param6,jdbcType=INTEGER}
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- </update>
-
- <update id="updateForUpDownByLayer" >
- update t_ware_store t set t.layer = #{param7,jdbcType=INTEGER}
- where t.ware_id in (
- select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
- ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- and t.ware_id = #{param1,jdbcType=VARCHAR}
- and t.stack_id = #{param2,jdbcType=VARCHAR}
- and t.layer >= #{param5,jdbcType=INTEGER}
- and t.layer <= #{param6,jdbcType=INTEGER}
- and ifnull(t.cancel_flag,'0') = '0'
- and ifnull(t.out_flag,'0') = '0'
- </update>
-
- <select id="selectByOutId" resultMap="BaseResultMap" >
- select t.* from t_ware_store t
- where t.ware_id in (
- select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
- ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- and t.out_id = #{param1,jdbcType=VARCHAR}
- </select>
-
-
- <update id="updateByOutId" >
- update t_ware_store t set t.cancel_flag = '1'
- where t.ware_id in (
- select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
- ) and t.belong_id = #{param4,jdbcType=VARCHAR}
- and t.out_id = #{param1,jdbcType=VARCHAR}
- </update>
-
-
- <select id="selectStore" resultMap="BaseResultMap" >
- select e.name as fk_customer_name,DATEDIFF(now(), t.add_time) + IF(TIME(now()) > TIME(t.add_time), 1, 0) as inware_day,t.*
- from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d,t_maint_customer e
- where t.ware_id = a.id
- and t.stack_id = b.id
- and t.material_id = c.id
- and t.customer_id = d.id
- and t.fk_compony_id = e.id
- and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
- and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
- and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
- and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
- and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
- and d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
- and e.name like concat('%',#{param9,jdbcType=VARCHAR},'%')
-
- and (t.plate_no like concat('%',#{param10,jdbcType=VARCHAR},'%')
- <if test="param13 != null and param13.size() !=0" >
- or t.plate_no IN <foreach item="item" collection="param13" index="index" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR} </foreach>
- </if>
- )
- and (t.ord_no like concat('%',#{param11,jdbcType=VARCHAR},'%')
- <if test="param14 != null and param14.size() !=0" >
- OR t.ord_no IN <foreach item="item" collection="param14" index="index" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR} </foreach>
- </if>
- )
- and (t.contract_no like concat('%',#{param12,jdbcType=VARCHAR},'%')
- <if test="param15 != null and param15.size() !=0" >
- OR t.contract_no IN <foreach item="item" collection="param15" index="index" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR} </foreach>
- </if>
- )
- and (t.pack_no like concat('%',#{param16,jdbcType=VARCHAR},'%')
- <if test="param17 != null and param17.size() !=0" >
- OR t.pack_no IN <foreach item="item" collection="param17" index="index" open="(" separator="," close=")">
- #{item,jdbcType=VARCHAR} </foreach>
- </if>
- )
- and t.belong_id = #{param8,jdbcType=VARCHAR}
- and t.cancel_flag = '0'
- and t.out_flag = '0'
- and t.ware_id in (
- select m.ware_id from t_maint_userware m where m.user_id = #{param7,jdbcType=VARCHAR}
- )
- order by b.code,t.layer desc
- </select>
- <select id="selectWareStackByDistributionStore" resultMap="StoreOfWareStack" >
- select distinct t.ware_id ,t.stack_id
- from t_ware_store t where t.id in
- <foreach item="item" index="index" collection="storeId"
- open="(" separator="," close=")">
- #{item}
- </foreach>
-
- </select>
-
-
- <select id="selectByWareIdStackIdInStoreId" resultMap="BaseResultMap" >
- select *
- from t_ware_store t where t.id in
- <foreach item="item" index="index" collection="storeId"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- and t.ware_id like concat('%',#{wareId,jdbcType=VARCHAR},'%')
- and t.stack_id like concat('%',#{stackId,jdbcType=VARCHAR},'%')
- </select>
-
-
- <update id="updateDistributionById" >
- update t_ware_store t
- set t.lock_flag = #{lockFlag,jdbcType=VARCHAR} where t.id in
- <foreach item="item" index="index" collection="storeId"
- open="(" separator="," close=")">
- #{item}
- </foreach>
-
- </update>
-
-
-
-
- <select id="selectForCustomer" resultMap="BaseResultMap" >
- select e.name as fk_compony_id,t.*
- from t_ware_store t left join t_maint_customer e
- on t.fk_compony_id = e.id
- , t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
- where t.ware_id = a.id
- and t.stack_id = b.id
- and t.material_id = c.id
- and t.customer_id = d.id
- and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
- and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
- and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
- and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
- and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
- <if test="param6 != null and param6 != ''" >
- and d.name = #{param6,jdbcType=VARCHAR}
- </if>
- and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
- and t.cancel_flag = '0'
- and t.out_flag = '0'
- and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
- and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
- </select>
- <select id="queryTotal" resultMap="TotalResultMap" >
- select sum(t.weight) as total_weight,
- sum(t.count) as total_amount
- from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
- where t.ware_id = a.id
- and t.stack_id = b.id
- and t.material_id = c.id
- and t.customer_id = d.id
- and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
- and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
- and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
- and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
- and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
- and d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
- and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
- and t.cancel_flag = '0'
- and t.out_flag = '0'
- and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
- and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
- </select>
-
- <select id="selEffStore" resultType="java.lang.Integer" parameterType="java.lang.String">
- select count(*)
- from t_ware_store t
- where t.cancel_flag = '0'
- and t.out_flag = '0'
- and t.plate_no = #{param1,jdbcType=VARCHAR};
-
- </select>
- </mapper>
|