• 模糊查询


     <select id="queryUserList" resultType="com.kakarote.admin.entity.VO.AdminUserVO">
            select a.realname,a.username,a.user_id,a.sex,a.mobile,a.email,e.name as deptName,a.status,a.create_time,a.dept_id,
            a.post,a.parent_id,a.customer_service,
            (select b.realname from wk_admin_user as b where b.user_id = a.parent_id) as parentName,
            (select m.realname from wk_admin_user as m where m.user_id = a.customer_service) as customerServiceName
            from wk_admin_user as a
            left join wk_admin_dept as e on a.dept_id = e.dept_id
            <if test="data.roleId != null">
                left join wk_admin_user_role as g on a.user_id = g.user_id
            </if>
            where  1=1
            <if test="data.realname != null and data.realname != ''">
                and (a.realname like concat('%', #{data.realname}, '%') or a.mobile like concat('%',#{data.realname}, '%'))
            </if>
            <if test="data.deptIdList.size()>0">
                and a.dept_id in
                <foreach item="item" collection="data.deptIdList" separator="," open="(" close=")" index="">
                   #{item}
                </foreach>
            </if>
            <if test="data.status != null">
                and a.status = #{data.status}
            </if>
            <choose>
                <when test="data.label != null and data.label==1">
                  AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(a.create_time)
                </when>
                <when test="data.label != null and data.label==2">
                    and a.status='2'
                </when>
                <when test="data.label != null and data.label==3">
                    and a.status = '0'
                </when>
            </choose>
            <if test="data.roleId != null">
                and g.role_id=#{data.roleId}
            </if>
            order by status desc
        </select>
    

      

  • 相关阅读:
    Go语言之Go语言文件处理
    Go语言之Go语言网络编程
    Go语言之Go语言并发
    Go语言之Go语言锁机制
    Go语言之Go语言 异常处理与测试
    Go语言之Go语言反射
    Go语言之Go 语言方法
    Go语言之递归函数
    js 改变文章字体大小
    .net获取当前url各种属性(文件名、参数、域名、端口等)的方法(转)
  • 原文地址:https://www.cnblogs.com/xianz666/p/13964641.html
Copyright © 2020-2023  润新知