优化报表的查询

This commit is contained in:
季圣华
2020-06-05 00:02:55 +08:00
parent c46ab52362
commit e8e43675fb
14 changed files with 225 additions and 394 deletions

View File

@@ -97,14 +97,6 @@
and ifnull(m.delete_Flag,'0') !='1'
</select>
<select id="findBySelect" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.UName from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1
and ifnull(m.delete_Flag,'0') !='1'
ORDER BY Id desc
</select>
<select id="findBySelectWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.UName,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
@@ -258,18 +250,4 @@
group by m.name
order by m.name asc
</select>
<select id="findByOrder" resultType="com.jsh.erp.datasource.entities.Material">
select m.*
FROM jsh_material m
where 1=1
<if test="name != null">
and m.name like '%${name}%'
</if>
<if test="model != null">
and m.model like '%${model}%'
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.name,m.model asc
</select>
</mapper>