调整,区分销售和库存扫码数量

main
masong 2 years ago
parent 9782dcc6ea
commit 4ef01cd325
  1. 6
      cjy-module-traceability/cjy-module-traceability-biz/src/main/resources/mapper/scanrecord/ScanRecordMapper.xml

@ -52,7 +52,7 @@
select count(id)as totalNum from traceability_scan_record
<if test=" type == 2">
<where>
product_id in ( select product_id from traceability_materials)
product_id in ( select product_id from traceability_sale_record)
</where>
</if>
</select>
@ -60,14 +60,14 @@
<select id="staticScanRecordToday" resultType="java.lang.Long">
select count(id) as todayNum from traceability_scan_record where DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')
<if test="type ==2">
and product_id in(select product_id from traceability_materials)
and product_id in(select product_id from traceability_sale_record)
</if>
</select>
<select id="staticScanRecordYesterday" resultType="java.lang.Long">
select count(id) as yesterday from traceability_scan_record where DATE_FORMAT(create_time,'%Y-%m-%d') = DATE(DATE_SUB(NOW(), INTERVAL 1 DAY))
<if test="type ==2">
and product_id in(select product_id from traceability_materials)
and product_id in(select product_id from traceability_sale_record)
</if>
</select>
</mapper>
Loading…
Cancel
Save