123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?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.emato.cus.supervise.mapperCus.CusAcqInventoryInfoMapper03">
- <resultMap id="cusAcqInventoryInfo" type="com.emato.cus.supervise.domainCus.CusAcqInventoryInfo03">
- <id property="id" column="id"/>
- <result property="goodsName" column="goods_name"/>
- <result property="codeTs" column="code_ts"/>
- <result property="skuNo" column="sku_no"/>
- <result property="goodsId" column="goods_id"/>
- <result property="gUnit" column="g_unit"/>
- <result property="gQty" column="g_qyt"/>
- <result property="legalUnit" column="legal_unit"/>
- <result property="legalQty" column="legal_qyt"/>
- <result property="goodsModel" column="goods_model"/>
- <result property="localEmsNo" column="local_ems_no"/>
- <result property="ownerCode" column="owner_code"/>
- <result property="ownerName" column="owner_name"/>
- <result property="storeCompanyName" column="store_company_name"/>
- <result property="storeUscCode" column="store_usc_code"/>
- <result property="storeCustomsCode" column="store_customs_code"/>
- <result property="storeCode" column="store_code"/>
- <result property="createrSn" column="creater_sn"/>
- <result property="createTime" column="create_time"/>
- <result property="moderSn" column="moder_sn"/>
- <result property="modTime" column="mod_time"/>
- </resultMap>
- <select id="listAcqInventoryInfo03" resultMap="cusAcqInventoryInfo" parameterType="List">
- select * from acq_inventory_info
- <where>
- <if test="list != null and list.size()>0">
- sku_no IN
- <foreach collection="list" item="sku" index="idx" open="(" separator="," close=")">
- #{sku}
- </foreach>
- </if>
- </where>
- </select>
- <!-- 库存数据 -->
- <insert id="addAcqInventoryInfo03" parameterType="List">
- INSERT INTO acq_inventory_info (goods_name, code_ts, sku_no, goods_id,
- g_unit, g_qyt, legal_unit, legal_qyt,
- goods_model, local_ems_no, owner_code, owner_name,
- store_company_name, store_usc_code, store_customs_code, store_code,
- creater_sn, create_time, moder_sn, mod_time
- )
- VALUES
- <foreach collection="list" item="item" index="idx" separator="," close=";">
- (
- #{item.goodsName, jdbcType=VARCHAR}, #{item.codeTs, jdbcType=VARCHAR}, #{item.skuNo, jdbcType=VARCHAR}, #{item.goodsId, jdbcType=VARCHAR},
- #{item.gUnit, jdbcType=VARCHAR}, #{item.gQty, jdbcType=NUMERIC}, #{item.legalUnit, jdbcType=VARCHAR}, #{item.legalQty, jdbcType=NUMERIC},
- #{item.goodsModel, jdbcType=VARCHAR}, #{item.localEmsNo, jdbcType=VARCHAR}, #{item.ownerCode, jdbcType=VARCHAR}, #{item.ownerName, jdbcType=VARCHAR},
- #{item.storeCompanyName, jdbcType=VARCHAR}, #{item.storeUscCode, jdbcType=VARCHAR}, #{item.storeCustomsCode, jdbcType=VARCHAR}, #{item.storeCode, jdbcType=VARCHAR},
- #{item.createrSn, jdbcType=VARCHAR}, #{item.createTime, jdbcType=DATE}, #{item.moderSn, jdbcType=VARCHAR}, #{item.modTime, jdbcType=DATE}
- )
- </foreach>
- </insert>
- <update id="updateAcqInventoryInfo03" parameterType="List">
- UPDATE acq_inventory_info
- <trim prefix="set" suffixOverrides=",">
- <trim prefix="goods_name =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.goodsName !=null and i.goodsName !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.goodsName, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="code_ts =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.codeTs !=null and i.codeTs !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.codeTs, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="g_unit =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.gUnit !=null and i.gUnit !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.gUnit, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="g_qyt =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.gQty !=null and i.gQty !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.gQty, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="legal_unit =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.legalUnit !=null and i.legalUnit !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.legalUnit, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="legal_qyt =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.legalQty !=null and i.legalQty !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.legalQty, jdbcType=VARCHAR}
- </if>
- </foreach>
- </trim>
- <trim prefix="goods_model =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.goodsModel !=null and i.goodsModel !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.goodsModel, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="owner_code =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.ownerCode !=null and i.ownerCode !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.ownerCode, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="owner_name =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.ownerName !=null and i.ownerName !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.ownerName, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="store_company_name =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.storeCompanyName !=null and i.storeCompanyName !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.storeCompanyName, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="store_usc_code =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.storeUscCode !=null and i.storeUscCode !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.storeUscCode, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="store_customs_code =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.storeCustomsCode !=null and i.storeCustomsCode !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.storeCustomsCode, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="store_code =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.storeCode !=null and i.storeCode !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.storeCode, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="moder_sn =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.moderSn !=null and i.moderSn !=''">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.moderSn, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- <trim prefix="mod_time =case" suffix="end,">
- <foreach collection="list" item="i" index="idx">
- <if test="i.modTime !=null">
- when sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo} then #{i.modTime, jdbcType=DATE}
- </if>
- </foreach>
- </trim>
- </trim>
- <where>
- <if test="list != null and list.size()>0">
- <foreach collection="list" item="i" index="index" separator="or" >
- sku_no=#{i.skuNo} and local_ems_no=#{i.localEmsNo}
- </foreach>
- </if>
- </where>
- </update>
- </mapper>
|