优化采购统计、进销存统计的查询逻辑,兼容高版本sql

This commit is contained in:
jishenghua 2025-03-08 23:15:51 +08:00
parent b26ac076de
commit 4a871a7f23
2 changed files with 7 additions and 3 deletions

View File

@ -482,7 +482,8 @@
and (dh.sub_type!='采购' and dh.sub_type!='采购退货' and dh.sub_type!='销售' and dh.sub_type!='销售退货')
</if>
and ifnull(dh.delete_flag,'0') !='1'
group by di.material_id
group by di.material_id, me.bar_code, m.name,m.model,m.standard,m.color,m.brand,m.mfrs,
mc.name, m.unit, u.basic_unit
<if test="column == 'createTime'">
order by materialId desc
</if>

View File

@ -376,7 +376,9 @@
and dh.oper_time &lt;= #{endTime}
</if>
and ifnull(m.delete_flag,'0') !='1'
group by m.id
group by m.id, me.bar_code, m.name, m.mfrs, m.model, m.standard, m.brand,
m.other_field1,m.other_field2,m.other_field3,m.unit, u.basic_unit, m.color, m.unit_id, u.name,
me.purchase_decimal, mcs.current_unit_price
order by m.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@ -473,7 +475,8 @@
and (dh.status = '1' or dh.status = '2' or dh.status = '3')
</if>
and ifnull(m.delete_flag,'0') !='1'
group by m.id
group by m.id, me.bar_code, m.name, m.mfrs, m.model, m.standard,
m.other_field1,m.other_field2,m.other_field3, m.unit, u.basic_unit, m.color, m.brand, u.name
order by m.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}