123456789101112131415161718192021222324252627282930313233343536373839 |
- <?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.mapper.WmsAcqGoodsSeatMapper">
- <!-- 库位上的货品信息 -->
- <select id="getWmsAcqGoodsSeat" parameterType="java.util.Map" resultType="com.emato.cus.supervise.domain.WmsAcqGoodsOnSeat">
- SELECT * FROM
- (SELECT
- th.companyCode AS merchSn,
- th.locationCode AS seatNo,
- th.itemName AS goodsName,
- th.itemCode AS codeTs,
- th.itemCode AS skuNo,
- th.itemCode AS goodsId,
- i.unitDesc AS gUnit,
- th.afterOnHandQty AS gQty,
- th.warehouseCode AS storeCode,
- CONCAT( i.itemSize, '-', i.itemColor, '-', i.itemStyle ) AS goodsModel
- FROM transaction_history th
- LEFT JOIN ( SELECT itemCode, locationCode, SUM( onHandQty ) AS qty FROM location_inventory GROUP BY itemCode, locationCode ) AS li
- ON th.itemCode = li.itemCode AND th.locationCode = li.locationCode
- LEFT JOIN item i ON th.itemCode = i.CODE
- <where>
- 1 = 1
- and th.zone in ('A区', 'B区', 'C区', 'GQ区', 'F区', 'P区')
- and (th.afterOnHandQty = li.qty or th.afterOnHandQty = 0)
- and li.qty is not null
- <if test="thisTime != null">
- and th.created >= #{thisTime}
- </if>
- </where>
- ORDER BY th.created DESC
- ) AS temp
- GROUP BY skuNo, seatNo
- </select>
- </mapper>
|