123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?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.biz.mapper.mall.InventoryDataMapper">
- <resultMap id="inventoryDataVO" type="com.emato.biz.domain.mall.InventoryDataPushVo">
- <result column="prod_barcode" property="barcode" />
- <result column="plu" property="plu" />
- <result column="mychem_id" property="mychemId" />
- <result column="name" property="productName"/>
- <result column="shop_sn" property="shopSn" />
- <result column="shop_inve" property="shopInvent" />
- <result column="valid_num" property="eMatou" />
- </resultMap>
- <resultMap id="inventoryDataDTO" type="com.emato.biz.domain.mall.InventoryDataDTO">
- <result column="prod_barcode" property="barcode" />
- <result column="sku" property="sku" />
- <result column="plu" property="plu" />
- <result column="mychem_id" property="mychemId" />
- <result column="name" property="productName"/>
- <result column="shop_sn" property="shopSn" />
- <result column="shop_inve" property="shopInvent" />
- <result column="valid_num" property="eMatou" />
- </resultMap>
- <!-- 查询库存数据 -->
- <select id="selectInventoryData" parameterType="com.emato.biz.domain.mall.InventoryReqVO" resultMap="inventoryDataDTO">
- SELECT
- t1.prod_barcode,
- t1.sku,
- t1.plu,
- t1.mychem_id,
- t1.name,
- t.shop_sn,
- t.shop_inve,
- t2.valid_num
- FROM
- wb_merch_shop_inve t
- INNER JOIN mall_goods t1 ON t.sku = t1.sku
- AND t.is_valid = '0'
- AND t1.is_delete = '0'
- LEFT JOIN wb_inve_mng t2 ON t2.sku = t.sku
- AND t2.inve_status = '0'
- AND t2.is_valid = '0'
- <if test="pageIndex != null and pageSize != null">
- limit #{pageIndex}, #{pageSize}
- </if>
- </select>
- <!-- 查询库存数据总条数 -->
- <select id="selectInventoryTotal" resultType="int">
- SELECT
- count( 1 )
- FROM
- wb_merch_shop_inve t
- INNER JOIN mall_goods t1 ON t.sku = t1.sku
- AND t.is_valid = '0'
- AND t1.is_delete = '0'
- LEFT JOIN wb_inve_mng t2 ON t2.sku = t.sku
- AND t2.inve_status = '0'
- AND t2.is_valid = '0'
- </select>
- <select id="getInventoryTotal" resultType="java.lang.Integer">
- SELECT
- count(*)
- FROM
- o_inventory_data
- </select>
- <insert id="inserInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo" >
- insert into o_inventory_data
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="barcode != null" >
- bar_code,
- </if>
- <if test="productName != null" >
- product_name,
- </if>
- <if test="shopCode != null" >
- shop_code,
- </if>
- <if test="shopName != null" >
- shop_name,
- </if>
- <if test="shopInvent != null" >
- shop_invent,
- </if>
- <if test="eMatou != null" >
- e_matou,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="barcode != null" >
- #{barcode},
- </if>
- <if test="productName != null" >
- #{productName},
- </if>
- <if test="shopCode != null" >
- #{shopCode},
- </if>
- <if test="shopName != null" >
- #{shopName},
- </if>
- <if test="shopInvent != null" >
- #{shopInvent},
- </if>
- <if test="eMatou != null" >
- #{eMatou},
- </if>
- </trim>
- </insert>
- <update id="updateInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo">
- update o_inventory_data
- <trim prefix="SET" suffixOverrides=",">
- <if test="shopInvent != null">shop_invent = #{shopInvent},</if>
- <if test="eMatou != null">e_matou = #{eMatou},</if>
- </trim>
- where bar_code = #{barcode} and shop_code = #{shopCode}
- </update>
- <select id="queryOneInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo" resultType="java.lang.Integer">
- select count(*) from o_inventory_data oid where bar_code = #{barcode} and shop_code = #{shopCode}
- </select>
- </mapper>
|