123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <?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.ruoyi.reportManagement.mapper.TWhgenlegMapper">
- <resultMap type="TWhgenleg" id="TWhgenlegResult">
- <result property="fAccyear" column="f_accyear"/>
- <result property="fId" column="f_id"/>
- <result property="fAccmonth" column="f_accmonth"/>
- <result property="fCorpid" column="f_corpid"/>
- <result property="fMblno" column="f_mblno"/>
- <result property="fOriginalbillno" column="f_originalbillno"/>
- <result property="fWarehouseLocationid" column="f_warehouse_locationid"/>
- <result property="fGoodsid" column="f_goodsid"/>
- <result property="fTrademodeid" column="f_trademodeid"/>
- <result property="fPreqty" column="f_preqty"/>
- <result property="fWarehouseid" column="f_warehouseid"/>
- <result property="fPregrossweight" column="f_pregrossweight"/>
- <result property="fPrenetweight" column="f_prenetweight"/>
- <result property="fQtyd" column="f_qtyD"/>
- <result property="fVolumnd" column="f_volumnD"/>
- <result property="fGrossweightd" column="f_grossweightD"/>
- <result property="fNetweightd" column="f_netweightD"/>
- <result property="fVolumnc" column="f_volumnC"/>
- <result property="fQtyc" column="f_qtyC"/>
- <result property="fQtyblc" column="f_qtyblc"/>
- <result property="fGrossweightc" column="f_grossweightC"/>
- <result property="fNetweightc" column="f_netweightC"/>
- <result property="fGrossweightblc" column="f_grossweightblc"/>
- <result property="fNetweightblc" column="f_netweightblc"/>
- <result property="fCntrno" column="f_cntrno"/>
- <result property="fMarks" column="f_marks"/>
- <result property="fStatus" column="f_status"/>
- <result property="delFlag" column="del_flag"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="remark" column="remark"/>
- </resultMap>
- <sql id="selectTWhgenlegVo">
- select f_accyear, f_id, f_accmonth, f_corpid, f_mblno, f_warehouseid, f_originalbillno, f_marks, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty, f_pregrossweight, f_prenetweight, f_qtyD, f_volumnD, f_grossweightD, f_netweightD, f_volumnC, f_qtyC, f_qtyblc, f_grossweightC, f_netweightC, f_grossweightblc, f_netweightblc, f_cntrno, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_whgenleg
- </sql>
- <select id="selectTWhgenlegList" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
- <include refid="selectTWhgenlegVo"/>
- <where>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
- <if test="fPreqty != null ">and f_preqty = #{fPreqty}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
- <if test="fPregrossweight != null ">and f_pregrossweight = #{fPregrossweight}</if>
- <if test="fPrenetweight != null ">and f_prenetweight = #{fPrenetweight}</if>
- <if test="fQtyd != null ">and f_qtyD = #{fQtyd}</if>
- <if test="fVolumnd != null ">and f_volumnD = #{fVolumnd}</if>
- <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
- <if test="fGrossweightd != null ">and f_grossweightD = #{fGrossweightd}</if>
- <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
- <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
- <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
- <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
- <if test="fQtyblc != null ">and f_qtyblc = #{fQtyblc}</if>
- <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
- <if test="fNetweightc != null ">and f_netweightC = #{fNetweightc}</if>
- <if test="fGrossweightblc != null ">and f_grossweightblc = #{fGrossweightblc}</if>
- <if test="fNetweightblc != null ">and f_netweightblc = #{fNetweightblc}</if>
- <if test="fCntrno != null and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
- <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
- </where>
- </select>
- <select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
- select
- leg.f_id AS fId,
- corp.f_name AS fCorpid,
- area.f_name AS fWarehouseLocationid,
- leg.f_warehouse_locationid AS fWarehouseLocationids,
- leg.f_trademodeid AS fTrademodeid,
- goods.f_name AS fGoodsid,
- leg.f_goodsid AS fGoodsids,
- leg.f_volumnD AS fVolumnD,
- leg.f_qtyD AS fQtyD,
- leg.f_mblno AS fMblno,
- leg.f_grossweightD AS fGrossweightD,
- leg.f_netweightD AS fNetweightD,
- leg.f_volumnC AS fVolumnC,
- leg.f_qtyC AS fQtyC,
- leg.f_grossweightC AS fGrossweightC,
- leg.f_netweightC AS fNetweightC,
- leg.f_qtyblc AS fQtyblc,
- leg.f_grossweightblc AS fGrossweightblc,
- leg.f_netweightblc AS fNetweightblc,
- leg.f_marks AS fMarks,
- DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
- leg.f_cntrno AS fCntrno
- FROM
- t_whgenleg leg
- LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
- LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
- LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
- <where>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
- <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
- <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
- <if test="fMblno != null ">and leg.f_mblno = #{fMblno}</if>
- <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
- <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
- <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
- <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid}</if>
- <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
- <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
- <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
- <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
- <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
- <if test="fMarks != null and fMarks != ''">and leg.f_marks = #{fMarks}</if>
- <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
- <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
- <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
- <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
- <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
- <if test="fCntrno != null and fCntrno != ''">and leg.f_cntrno = #{fCntrno}</if>
- <if test="fStatus != null and fStatus != ''">and leg.f_status = #{fStatus}</if>
- </where>
- </select>
- <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
- <include refid="selectTWhgenlegVo"/>
- <where>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
- <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
- <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
- <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
- </where>
- </select>
- <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult">
- <include refid="selectTWhgenlegVo"/>
- where f_accyear = #{fAccyear}
- </select>
- <insert id="insertTWhgenleg" parameterType="TWhgenleg">
- insert into t_whgenleg
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fAccyear != null">f_accyear,</if>
- <if test="fId != null">f_id,</if>
- <if test="fAccmonth != null">f_accmonth,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="fMblno != null">f_mblno,</if>
- <if test="fOriginalbillno != null">f_originalbillno,</if>
- <if test="fWarehouseLocationid != null">f_warehouse_locationid,</if>
- <if test="fGoodsid != null">f_goodsid,</if>
- <if test="fTrademodeid != null">f_trademodeid,</if>
- <if test="fPreqty != null">f_preqty,</if>
- <if test="fWarehouseid != null">f_warehouseid,</if>
- <if test="fPregrossweight != null">f_pregrossweight,</if>
- <if test="fPrenetweight != null">f_prenetweight,</if>
- <if test="fVolumnd != null">f_volumnD,</if>
- <if test="fQtyd != null">f_qtyD,</if>
- <if test="fGrossweightd != null">f_grossweightD,</if>
- <if test="fNetweightd != null">f_netweightD,</if>
- <if test="fVolumnc != null">f_volumnC,</if>
- <if test="fQtyc != null">f_qtyC,</if>
- <if test="fQtyblc != null">f_qtyblc,</if>
- <if test="fGrossweightc != null">f_grossweightC,</if>
- <if test="fGrossweightblc != null">f_grossweightblc,</if>
- <if test="fNetweightc != null">f_netweightC,</if>
- <if test="fNetweightblc != null">f_netweightblc,</if>
- <if test="fCntrno != null">f_cntrno,</if>
- <if test="fStatus != null">f_status,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="fMarks != null and fMarks != ''">f_marks,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fAccyear != null">#{fAccyear},</if>
- <if test="fId != null">#{fId},</if>
- <if test="fAccmonth != null">#{fAccmonth},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="fMblno != null">#{fMblno},</if>
- <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
- <if test="fWarehouseLocationid != null">#{fWarehouseLocationid},</if>
- <if test="fGoodsid != null">#{fGoodsid},</if>
- <if test="fTrademodeid != null">#{fTrademodeid},</if>
- <if test="fPreqty != null">#{fPreqty},</if>
- <if test="fWarehouseid != null">#{fWarehouseid},</if>
- <if test="fPregrossweight != null">#{fPregrossweight},</if>
- <if test="fPrenetweight != null">#{fPrenetweight},</if>
- <if test="fVolumnd != null">#{fVolumnd},</if>
- <if test="fQtyd != null">#{fQtyd},</if>
- <if test="fGrossweightd != null">#{fGrossweightd},</if>
- <if test="fNetweightd != null">#{fNetweightd},</if>
- <if test="fVolumnc != null">#{fVolumnc},</if>
- <if test="fQtyc != null">#{fQtyc},</if>
- <if test="fQtyblc != null">#{fQtyblc},</if>
- <if test="fGrossweightc != null">#{fGrossweightc},</if>
- <if test="fGrossweightblc != null">#{fGrossweightblc},</if>
- <if test="fNetweightc != null">#{fNetweightc},</if>
- <if test="fNetweightblc != null">#{fNetweightblc},</if>
- <if test="fCntrno != null">#{fCntrno},</if>
- <if test="fStatus != null">#{fStatus},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTWhgenleg" parameterType="TWhgenleg">
- update t_whgenleg
- <trim prefix="SET" suffixOverrides=",">
- <if test="fId != null">f_id = #{fId},</if>
- <if test="fAccmonth != null">f_accmonth = #{fAccmonth},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="fMblno != null">f_mblno = #{fMblno},</if>
- <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
- <if test="fWarehouseLocationid != null">f_warehouse_locationid = #{fWarehouseLocationid},</if>
- <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
- <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
- <if test="fPreqty != null">f_preqty = #{fPreqty},</if>
- <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
- <if test="fPregrossweight != null">f_pregrossweight = #{fPregrossweight},</if>
- <if test="fPrenetweight != null">f_prenetweight = #{fPrenetweight},</if>
- <if test="fVolumnd != null">f_volumnD = #{fVolumnd},</if>
- <if test="fQtyd != null">f_qtyD = #{fQtyd},</if>
- <if test="fGrossweightd != null">f_grossweightD = #{fGrossweightd},</if>
- <if test="fNetweightd != null">f_netweightD = #{fNetweightd},</if>
- <if test="fVolumnc != null">f_volumnC = #{fVolumnc},</if>
- <if test="fQtyc != null">f_qtyC = #{fQtyc},</if>
- <if test="fQtyblc != null">f_qtyblc = #{fQtyblc},</if>
- <if test="fGrossweightc != null">f_grossweightC = #{fGrossweightc},</if>
- <if test="fGrossweightblc != null">f_grossweightblc = #{fGrossweightblc},</if>
- <if test="fNetweightc != null">f_netweightC = #{fNetweightc},</if>
- <if test="fNetweightblc != null">f_netweightblc = #{fNetweightblc},</if>
- <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
- <if test="fStatus != null">f_status = #{fStatus},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where f_accyear = #{fAccyear}
- </update>
- <update id="updateTWhgenlegData" parameterType="Map">
- update t_whgenleg
- <trim prefix="SET" suffixOverrides=",">
- /*判断是否入库*/
- <if test="map.billType == 'SJRK'">
- f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
- f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
- f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
- f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
- f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
- </if>
- /*判断是否撤销入库*/
- <if test="map.billType == 'SJRKRevoke'">
- f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
- f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
- f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
- f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
- f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
- </if>
- /*判断是否出库*/
- <if test="map.billType == 'SJCK'">
- f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
- f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
- f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
- f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
- f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
- </if>
- /*判断是否撤销出库*/
- <if test="map.billType == 'SJCKRevoke'">
- f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
- f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
- f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
- f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
- f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
- </if>
- -- update_by = NOW()
- </trim>
- where f_id = #{map.whgenlegId}
- </update>
- <delete id="deleteTWhgenlegById" parameterType="Long">
- delete from t_whgenleg where f_accyear = #{fAccyear}
- </delete>
- <delete id="deleteTWhgenlegByIds" parameterType="String">
- delete from t_whgenleg where f_accyear in
- <foreach item="fAccyear" collection="array" open="(" separator="," close=")">
- #{fAccyear}
- </foreach>
- </delete>
- </mapper>
|