123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?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.gree.mall.miniapp.commonmapper.stock.MaterialGoodsStockCMapper">
- <select id="queryWebsitGoodsCategoryList" resultType="com.gree.mall.miniapp.plus.entity.WebsitGoodsCategory">
- select
- distinct
- a.*
- from websit_goods_category a
- join worker_goods b on a.category_id = b.goods_category_id
- join worker_stock c on c.goods_id = b.goods_id
- <where>
- <if test="goodsType != null and goodsType !=''">
- and c.goods_type = #{goodsType}
- </if>
- <if test="websitId != null and websitId !=''">
- and c.websit_id = #{websitId}
- </if>
- and c.identity = #{user.idCard}
- </where>
- </select>
- <select id="queryWorkerStockList" resultType="com.gree.mall.miniapp.bean.material.stock.WorkerStockBean">
- select
- a.*,
- <if test="goodsType != null and goodsType == 'M'.toString()">
- c.category_name,
- </if>
- b.goods_category_id
- from worker_stock a
- join worker_goods b on a.goods_id=b.goods_id
- <if test="goodsType != null and goodsType == 'M'.toString()">
- join websit_goods_category c on c.category_id = b.goods_category_id
- </if>
- <where>
- <if test="goodsType != null and goodsType !=''">
- and a.goods_type = #{goodsType}
- </if>
- <if test="websitId != null and websitId !=''">
- and a.websit_id = #{websitId}
- </if>
- and a.identity = #{user.idCard}
- <if test="goodsType == null">
- and a.worker_id = ''
- </if>
- <if test="categoryId != null and categoryId !=''">
- and b.goods_category_id = #{categoryId}
- </if>
- </where>
- </select>
- <select id="queryExistWebsitStockList" resultType="com.gree.mall.miniapp.plus.entity.WebsitStock">
- SELECT
- *
- FROM
- websit_stock
- WHERE
- company_wechat_id = #{companyWechatId}
- AND
- websit_id = #{websitId}
- AND
- storage_id = #{storageId}
- AND
- goods_id IN
- <foreach item="item" index="index" collection="stockList" open="(" separator=","
- close=")">
- #{item.goodsId}
- </foreach>
- FOR UPDATE
- </select>
- <select id="queryExistWorkerStockList" resultType="com.gree.mall.miniapp.plus.entity.WorkerStock">
- SELECT
- *
- FROM
- worker_stock
- WHERE
- company_wechat_id = #{dto.companyWechatId}
- AND identity = #{dto.identity}
- AND goods_id IN
- <foreach item="item" index="index" collection="stockList" open="(" separator=","
- close=")">
- #{item.goodsId}
- </foreach>
- FOR UPDATE
- </select>
- </mapper>
|