修改可能存在的sql问题

This commit is contained in:
qiankunpingtai
2019-06-10 10:57:29 +08:00
parent d90841a665
commit 65f4169ec3

View File

@@ -68,11 +68,15 @@
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and dh.OperTime &lt;= #{endTime} and dh.OperTime &lt;= #{endTime}
</if> </if>
<if test="materialParam != null"> <if test="materialParam != null and materialParam != ''">
and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%') <bind name="materialParam" value="'%' + _parameter.materialParam + '%'"/>
and (m.Name like #{materialParam} or m.Model like #{materialParam})
</if> </if>
<if test="depotIds != null"> <if test="depotIds != null and depotIds != ''">
and di.DepotId in (${depotIds}) and di.DepotId in
<foreach item="did" index="index" collection="depotIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
order by dh.Id desc order by dh.Id desc
@@ -103,11 +107,15 @@
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
and dh.OperTime &lt;= #{endTime} and dh.OperTime &lt;= #{endTime}
</if> </if>
<if test="materialParam != null"> <if test="materialParam != null and materialParam != ''">
and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%') <bind name="materialParam" value="'%' + _parameter.materialParam + '%'"/>
and (m.Name like #{materialParam} or m.Model like #{materialParam})
</if> </if>
<if test="depotIds != null"> <if test="depotIds != null and depotIds != ''">
and di.DepotId in (${depotIds}) and di.DepotId in
<foreach item="did" index="index" collection="depotIds.split(',')" open="(" separator="," close=")">
#{did}
</foreach>
</if> </if>
and ifnull(dh.delete_Flag,'0') !='1' and ifnull(dh.delete_Flag,'0') !='1'
</select> </select>