Browse Source

【政策找人】查询列表动作,支持传入is_null/is_not_null

dev
wangxianzhang 3 years ago
parent
commit
fa1a116aa4
  1. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -116,13 +116,24 @@
<if test="resiRules != null and resiRules.size() > 0"> <if test="resiRules != null and resiRules.size() > 0">
and and
<foreach collection="resiRules" item="rule" open="(" close=")"> <foreach collection="resiRules" item="rule" open="(" close=")">
${rule.colTable}.${rule.colKey} ${rule.queryType}
<choose> <choose>
<when test="rule.queryType == 'like'"> <!--针对为空/不为空进行单独处理-->
CONCAT('%',#{rule.colVal} ,'%') <when test="rule.queryType == 'is_null'">
(${rule.colTable}.${rule.colKey} is null or ${rule.colTable}.${rule.colKey} = '')
</when>
<when test="rule.queryType == 'is_not_null'">
(${rule.colTable}.${rule.colKey} is not null and ${rule.colTable}.${rule.colKey} != '')
</when> </when>
<otherwise> <otherwise>
#{rule.colVal} ${rule.colTable}.${rule.colKey} ${rule.queryType}
<choose>
<when test="rule.queryType == 'like'">
CONCAT('%',#{rule.colVal} ,'%')
</when>
<otherwise>
#{rule.colVal}
</otherwise>
</choose>
</otherwise> </otherwise>
</choose> </choose>
${rule.nextLogicalRel} ${rule.nextLogicalRel}

Loading…
Cancel
Save