1.sql添加条件

main
862857010@qq.com 2 years ago
parent d7546efcad
commit 466ca7dda7
  1. 3
      cjy-project/src/main/resources/mapper/emergencycommand/GroupingUserInfoMapper.xml

@ -120,12 +120,13 @@
LEFT JOIN sys_dept t3 ON t2.dept_id = t3.dept_id
LEFT JOIN ec_grouping_config t4 ON t1.grouping_id = t4.id and t2.organ_code = t4.organ_code AND t4.del_flag!=2
LEFT JOIN ti_enterprise_info t5 ON t2.organ_code = t5.organ_code
and t5.del_flag != 2
<where>
<if test="groupingId != null ">and t1.grouping_id = #{groupingId}</if>
<if test="userName != null ">and t2.nick_name like concat('%',#{userName},'%')</if>
<if test="deptId != null ">and t3.dept_id =#{deptId}</if>
<if test="organCode != null ">and t2.organ_code = #{organCode}</if>
and t5.del_flag != 2
</where>
</select>

Loading…
Cancel
Save