日期和sql优化

This commit is contained in:
季圣华
2021-06-09 20:29:36 +08:00
parent f04dcd220c
commit 99e7db36d3
30 changed files with 361 additions and 243 deletions

View File

@@ -12,13 +12,15 @@
FROM jsh_account_item
where 1=1
<if test="name != null">
and name like '%${name}%'
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
<if test="type != null">
and type=${type}
and type=#{type}
</if>
<if test="remark != null">
and remark like '%${remark}%'
<bind name="bindRemark" value="'%'+remark+'%'"/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
@@ -31,13 +33,15 @@
FROM jsh_account_item
WHERE 1=1
<if test="name != null">
and name like '%${name}%'
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
<if test="type != null">
and type=${type}
and type=#{type}
</if>
<if test="remark != null">
and remark like '%${remark}%'
<bind name="bindRemark" value="'%'+remark+'%'"/>
and remark like #{bindRemark}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
@@ -46,7 +50,7 @@
select ai.*,a.Name AccountName,ioi.Name InOutItemName
from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.header_id = ${headerId}
where ai.header_id = #{headerId}
and ifnull(ai.delete_flag,'0') !='1'
order by ai.id asc
</select>