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

Loading…
Cancel
Save