|
|
|
@ -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> |