李宇
2021-04-09 dac136a54c51842a9cd9abd97c236b43cb48d169
src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml
@@ -65,14 +65,17 @@
    <if test="seeFlag != null">
      and su.see_flag = #{seeFlag}
    </if>
    <if test="seeFlag != null">
      and su.see_flag = #{seeFlag}
    </if>
    <if test="editId != null and editId != ''">
      and su.id != #{editId}
    </if>
    <if test="waster != null">
        and su.waster = #{waster}
    </if>
    <if test="project != null and project != ''">
        and su.project like concat("%",#{project},"%")
    </if>
    <if test="company != null and company != ''">
         and bm1.meta_value like concat("%",#{company},"%")
    </if>
  </sql>
@@ -117,6 +120,7 @@
    select su.*, br.name as roleName from sys_user as su
    left join base_role as br on su.role_id = br.id
      left join base_meta bm on su.department = bm.id
      left join base_meta bm1 on bm1.id = su.company
    where su.valid_flag = 1
      <if test="departmentNameLike != null and departmentNameLike != ''">
          and bm.meta_value  like #{departmentNameLike}
@@ -150,7 +154,9 @@
  </select>
  <select id="getSysUserTotalCount" parameterType="java.util.Map" resultType="int">
    select count(1) from sys_user as su left join base_meta bm on su.department = bm.id
    select count(1) from sys_user as su
    left join base_meta bm on su.department = bm.id
    left join base_meta bm1 on bm1.id = su.company
    where su.valid_flag = 1
      <if test="departmentNameLike != null and departmentNameLike != ''">
          and bm.meta_value  like #{departmentNameLike}
@@ -263,6 +269,63 @@
    AND waster = '1'
    AND project = #{project};
    </select>
    <select id="getUserByArp" resultMap="SysUser">
        select * from sys_user
        where arp = #{0} and valid_flag = 1
    </select>
    <select id="getUserCountInProject" parameterType="java.util.Map"  resultType="java.lang.Integer">
        select count(1) from sys_user as su
        left join base_meta bm on su.department = bm.id
        left join base_meta bm1 on bm1.id = su.company
        where su.valid_flag = 1
        <if test="departmentNameLike != null and departmentNameLike != ''">
            and bm.meta_value  like concat("%",#{departmentNameLike},"%")
        </if>
        <if test="arp != null and arp != ''">
            and su.arp like concat("%",#{arp},"%")
        </if>
        <if test="name != null and name != ''">
            and su.name like concat("%",#{name},"%")
        </if>
        <if test="company != null and company != ''">
            and bm1.meta_value like concat("%",#{company},"%")
        </if>
        <if test="project != null and project != ''">
            and
            <foreach item="item" index="index" collection="project.split(',')" open="(" separator="or" close=")">
                 su.project like concat("%",#{item},"%")
            </foreach>
        </if>
    </select>
    <select id="getUserInProject" parameterType="java.util.Map" resultMap="SysUser">
        select su.*, br.name as roleName from sys_user as su
        left join base_role as br on su.role_id = br.id
        left join base_meta bm on su.department = bm.id
        left join base_meta bm1 on bm1.id = su.company
        where su.valid_flag = 1
        <if test="departmentNameLike != null and departmentNameLike != ''">
            and bm.meta_value  like concat("%",#{departmentNameLike},"%")
        </if>
        <if test="arp != null and arp != ''">
            and su.arp like concat("%",#{arp},"%")
        </if>
        <if test="name != null and name != ''">
            and su.name like concat("%",#{name},"%")
        </if>
        <if test="company != null and company != ''">
            and bm1.meta_value like concat("%",#{company},"%")
        </if>
        <if test="project != null and project != ''">
            and
            <foreach item="item" index="index" collection="project.split(',')" open="(" separator="or" close=")">
                su.project like concat("%",#{item},"%")
            </foreach>
        </if>
        order by su.arp ASC
        <if test="first != null and pageSize != null">
            limit #{first}, #{pageSize}
        </if>
    </select>
    <update id="updateUserPointBySelective" parameterType="java.util.Map">
    update sys_user set point=#{point}
    <where>