#
luxiaotao1123
2024-03-29 7c32ab19d3bf4c601212314a1617bbb51c5fdd2a
zy-asrs-wcs/src/main/resources/mapper/system/UserMapper.xml
@@ -19,10 +19,33 @@
        from sys_user su
        left join sys_dept sd on su.dept_id = sd.id
        where 1=1
        and su.deleted = 0
        <if test="param.deptId != null">
            and (FIND_IN_SET(#{param.deptId}, sd.`path`) OR sd.`id` = #{param.deptId})
        </if>
        order by su.create_time desc
        <if test="param.username != null">
            and su.username like concat('%',#{param.username},'%')
        </if>
        <if test="param.nickname != null">
            and su.nickname like concat('%',#{param.nickname},'%')
        </if>
        <if test="param.phone != null">
            and su.phone like concat('%',#{param.phone},'%')
        </if>
        <if test="param.sex != null">
            and su.sex = #{param.sex}
        </if>
        <if test="param.status != null">
            and su.status = #{param.status}
        </if>
        <if test="param.condition != null">
            and (
                   su.username like concat('%',#{param.condition},'%')
                or su.nickname like concat('%',#{param.condition},'%')
                or su.phone like concat('%',#{param.condition},'%')
            )
        </if>
        order by su.create_time
    </select>
</mapper>