You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/resources/mybatis/mapper/inv/StockCompareDetailMapper.xml

68 lines
2.6 KiB
XML

<?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.glxp.api.dao.inv.StockCompareDetailMapper">
<select id="invProductDetailSelectPage" resultType="com.glxp.api.vo.inv.InvProductDetailSelectVo">
SELECT ipd.relId productId,
ipd.batchNo,
udi.${param.thirdTableField} thrProductId,
p.cpmctymc,
p.ggxh,
p.nameCode,
p.cpms,
p.manufactory,
p.zczbhhzbapzbh,
p.ylqxzcrbarmc,
ipd.mainAction,
sum(ipd.count) count
FROM inv_product_detail ipd
LEFT JOIN basic_udirel udi ON udi.id = ipd.relId
LEFT JOIN basic_products p ON p.uuid = udi.uuid
<where>
udi.${param.thirdTableField} is not null
and ipd.invCode = #{param.invCode}
and ipd.updateTime between concat(#{param.compareStartDate}, ' 00:00:00') and
concat(#{param.compareEndDate}, ' 23:59:59')
<if test="param.mainAction != null and param.mainAction != ''">
and ipd.mainAction = #{param.mainAction}
</if>
<if test="param.action != null and param.action != ''">
and ipd.action = #{param.action}
</if>
<if test="param.productIds != null">
and ipd.relId in
<foreach collection="param.productIds" open="(" item="item" separator="," close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY
ipd.relId,
ipd.mainAction
ORDER BY
ipd.relId,
ipd.mainAction
</select>
<select id="filterCompareDetail" resultType="com.glxp.api.res.inv.StockCompareDetailResponse">
SELECT p.cpmctymc,
p.ggxh,
p.nameCode,
p.cpms,
p.manufactory,
p.zczbhhzbapzbh,
p.ylqxzcrbarmc,
ipd.mainAction,
ipd.*
FROM inv_stock_compare_detail ipd
LEFT JOIN basic_udirel udi ON udi.id = ipd.productId
LEFT JOIN basic_products p ON p.uuid = udi.uuid
<where>
<if test="compareId != null and compareId != ''">
and ipd.compareId = #{compareId}
</if>
</where>
</select>
</mapper>