Browse Source

map 不空的时候

master
453530270@qq.com 2 years ago
parent
commit
e1e63af6a8
  1. 28
      src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml

28
src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml

@ -72,19 +72,21 @@
select count(*)
from
<include refid="tbName"/>
<where>
<foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != '' and k!='rule_name' and k!='btstr'">
${k} = #{v}
</if>
<if test="k=='rule_name'">
rule_name like concat('%',#{v},'%')
</if>
<if test="k=='btstr'">
${v}
</if>
</foreach>
</where>
<if test="map!=null">
<where>
<foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != '' and k!='rule_name' and k!='btstr'">
${k} = #{v}
</if>
<if test="k=='rule_name'">
rule_name like concat('%',#{v},'%')
</if>
<if test="k=='btstr'">
${v}
</if>
</foreach>
</where>
</if>
</select>
<!-- 统计数量 -->
<select id="countAcRs" resultType="java.lang.Integer">

Loading…
Cancel
Save