| | |
| | | <result property="password" column="password"></result> |
| | | <result property="company" column="company"></result> |
| | | <result property="department" column="department"></result> |
| | | <result property="departmentName" column="department_name"></result> |
| | | <result property="name" column="name"></result> |
| | | <result property="phone" column="phone"></result> |
| | | <result property="email" column="email"></result> |
| | |
| | | <result property="updateTime" column="update_time"></result> |
| | | <result property="roleName" column="roleName"></result> |
| | | <result property="containerCodeList" column="containerCodeList"></result> |
| | | <result property="project" column="project"></result> |
| | | <result property="projectId" column="project_id"></result> |
| | | <result property="projectName" column="project_name"></result> |
| | | <result property="url" column="url"></result> |
| | | <result property="score" column="score"></result> |
| | | <result property="waster" column="waster" typeHandler="com.nanometer.smartlab.entity.handler.WasterHandler"></result> |
| | |
| | | <if test="waster != null"> |
| | | and su.waster = #{waster} |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | <if test="projectId != null and projectId != ''"> |
| | | and su.project_id =#{projectId} |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | and sp.project_name like concat("%",#{projectName},"%") |
| | | </if> |
| | | <if test="company != null and company != ''"> |
| | | and bm1.meta_value like concat("%",#{company},"%") |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getSysUser" parameterType="java.lang.String" resultMap="SysUser" > |
| | | <select id="getSysUser" resultMap="SysUser" > |
| | | select * from sys_user |
| | | where id = #{id} and valid_flag = 1 |
| | | </select> |
| | | |
| | | <select id="getUser" parameterType="java.lang.String" resultMap="SysUser"> |
| | | <select id="getUser" resultMap="SysUser"> |
| | | select |
| | | sys_user.id, |
| | | sys_user.`name`, |
| | | sys_user.phone, |
| | | sys_user.project, |
| | | base_meta.meta_value as department |
| | | sys_user.project_id, |
| | | base_meta.meta_value as department_name |
| | | from sys_user |
| | | left join base_meta on sys_user.department = base_meta.id |
| | | where sys_user.id = #{id} |
| | |
| | | and base_meta.valid_flag = 1 |
| | | </select> |
| | | |
| | | <insert id="insertUserFavor" parameterType="java.util.Map"> |
| | | insert into favor(id,user_id,reagent_id,create_time) value (#{id},#{user},#{reagent},now()); |
| | | <insert id="insertUserFavor" parameterType="java.util.Map" useGeneratedKeys = "true" keyProperty = "id"> |
| | | insert into favor(user_id,reagent_id,create_time) value (#{user},#{reagent},now()); |
| | | </insert> |
| | | |
| | | <select id="getSysUserForSuppllier" parameterType="java.lang.String" resultMap="SysUser" > |
| | | <select id="getSysUserForSuppllier" resultMap="SysUser" > |
| | | select * from sys_user |
| | | where id = #{id} |
| | | </select> |
| | |
| | | |
| | | |
| | | |
| | | <select id="getSysUserByIdCard" parameterType="java.lang.String" resultMap="SysUser" > |
| | | <select id="getSysUserByIdCard" resultMap="SysUser" > |
| | | select * from sys_user |
| | | where id_card = #{idCard} |
| | | and valid_flag = 1 |
| | |
| | | </select> |
| | | |
| | | <select id="getSysUserList" parameterType="java.util.Map" resultMap="SysUser"> |
| | | select su.*, br.name as roleName from sys_user as su |
| | | select su.*, br.name as roleName,sp.project_name 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | where su.valid_flag = 1 |
| | | <if test="departmentNameLike != null and departmentNameLike != ''"> |
| | | and bm.meta_value like #{departmentNameLike} |
| | |
| | | </select> |
| | | |
| | | <select id="getSysUserSimpleInfoList" parameterType="java.util.Map" resultMap="SysUser"> |
| | | select su.id,su.arp,su.account,su.name,su.phone,su.email,su.create_time,su.project,bm.meta_value as department,bm1.meta_value as company from sys_user as su |
| | | select su.id,su.arp,su.account,su.name,su.phone,su.email,su.create_time,su.project_id,bm.meta_value as department,bm1.meta_value as company,sp.project_name 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | where su.valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | order by su.arp ASC |
| | |
| | | |
| | | <select id="getHasProjectSysUserList" parameterType="java.util.Map" resultMap="SysUser"> |
| | | select DISTINCT su.*, br.name as roleName from sys_user as su |
| | | left join base_role as br on su.role_id = br.id inner join sys_project as sp on su.id=sp.sys_user_id |
| | | left join base_role as br on su.role_id = br.id |
| | | inner join sys_project as sp on su.id=sp.sys_user_id |
| | | where su.valid_flag = 1 |
| | | <if test="department != null and department != ''"> |
| | | and su.department = #{department} |
| | |
| | | <if test="approverFlag != null"> |
| | | and su.approver_flag = #{approverFlag} |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and (su.project like concat('%',#{project},'%') |
| | | or su.project is null or su.project = '') |
| | | <if test="projectId != null and projectId != ''"> |
| | | and su.project_id =#{projectId} |
| | | </if> |
| | | order by su.arp ASC |
| | | <if test="first != null and pageSize != null"> |
| | |
| | | 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | where su.valid_flag = 1 |
| | | <if test="departmentNameLike != null and departmentNameLike != ''"> |
| | | and bm.meta_value like #{departmentNameLike} |
| | |
| | | <include refid="queryWhereSql"/> |
| | | </select> |
| | | |
| | | <insert id="insertSysUser" parameterType="com.nanometer.smartlab.entity.SysUser"> |
| | | insert into sys_user(id, arp, account, password, company, department, name, phone, email, memo, id_card, approver_flag, see_flag, role_id, valid_flag, create_time, update_time,project,waster,url,score) |
| | | values (#{id}, #{arp}, #{account}, #{password}, #{company}, #{department}, #{name}, #{phone}, #{email}, #{memo}, #{idCard}, #{approverFlag}, #{seeFlag}, #{roleId}, 1, now(), now(),#{project},#{waster},#{url},#{score}) |
| | | <insert id="insertSysUser" parameterType="com.nanometer.smartlab.entity.SysUser" useGeneratedKeys = "true" keyProperty = "id"> |
| | | insert into sys_user( arp, account, password, company, department, name, phone, email, memo, id_card, approver_flag, see_flag, role_id, valid_flag, create_time, update_time,project_id,waster,url,score) |
| | | values ( #{arp}, #{account}, #{password}, #{company}, #{department}, #{name}, #{phone}, #{email}, #{memo}, #{idCard}, #{approverFlag}, #{seeFlag}, #{roleId}, 1, now(), now(),#{projectId},#{waster},#{url},#{score}) |
| | | </insert> |
| | | |
| | | <update id="updateSysUser" parameterType="com.nanometer.smartlab.entity.SysUser"> |
| | | update sys_user set arp=#{arp}, account=#{account}, password=#{password}, company=#{company}, department=#{department}, name=#{name}, phone=#{phone}, |
| | | email=#{email}, memo=#{memo}, id_card=#{idCard}, approver_flag=#{approverFlag}, see_flag=#{seeFlag}, role_id=#{roleId}, point=#{point},update_time=now(),project=#{project},waster=#{waster}, |
| | | email=#{email}, memo=#{memo}, id_card=#{idCard}, approver_flag=#{approverFlag}, see_flag=#{seeFlag}, role_id=#{roleId}, point=#{point},update_time=now(),project_id=#{projectId},waster=#{waster}, |
| | | url= #{url}, |
| | | score = #{score} |
| | | where id=#{id} |
| | |
| | | </select> |
| | | |
| | | <select id="getUserListByProject" parameterType="java.util.Map" resultMap="SysUser"> |
| | | SELECT u.name,u.see_flag,u.role_id,u.valid_flag,u.id_card,bm2.meta_value department,bm1.meta_value company,u.arp,u.point,u.project |
| | | SELECT u.name,u.see_flag,u.role_id,u.valid_flag,u.id_card,bm2.meta_value department,bm1.meta_value company,u.arp,u.point,u.project_id |
| | | from sys_user u |
| | | left join base_meta bm1 on bm1.id = u.company |
| | | left join base_meta bm2 on bm2.id = u.department |
| | | where |
| | | u.project = #{0} |
| | | u.project_id = #{0} |
| | | and u.valid_flag = 1 |
| | | and u.update_time >= #{1} and #{2} > u.update_time |
| | | </select> |
| | |
| | | SELECT |
| | | su.id, |
| | | su.account, |
| | | su.id_card, |
| | | su.`name`, |
| | | su.`password`, |
| | | su.waster as adminFlag, |
| | | su.project, |
| | | su.project_id, |
| | | bm.meta_value as department, |
| | | com.meta_value as company |
| | | com.meta_value as company_name, |
| | | com.id as company, |
| | | sp.project_name |
| | | FROM sys_user AS su |
| | | LEFT JOIN base_meta bm ON su.department = bm.id |
| | | LEFT JOIN base_meta com on com.id = su.company |
| | | left join sys_project sp on sp.id=su.project_id |
| | | <where> |
| | | su.valid_flag = 1 |
| | | <if test="account != null and account !=''"> |
| | | AND su.account = #{account} |
| | | </if> |
| | | <if test="name != null and name !=''"> |
| | | AND su.name = #{name} |
| | | <if test="userId != null "> |
| | | AND su.id = #{userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | WHERE |
| | | valid_flag = '1' |
| | | AND waster = '1' |
| | | AND project = #{project}; |
| | | AND project_id = #{projectId}; |
| | | </select> |
| | | <select id="getUserByArp" resultMap="SysUser"> |
| | | select * from sys_user |
| | |
| | | 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | where su.valid_flag = 1 |
| | | <if test="departmentNameLike != null and departmentNameLike != ''"> |
| | | and bm.meta_value like concat("%",#{departmentNameLike},"%") |
| | |
| | | <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 test="projectId != null and projectId != ''"> |
| | | and su.project_id=#{projectId} |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | and sp.projectName like concat("%",#{projectId},"%") |
| | | </if> |
| | | </select> |
| | | <select id="getUserInProject" parameterType="java.util.Map" resultMap="SysUser"> |
| | |
| | | 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | where su.valid_flag = 1 |
| | | <if test="departmentNameLike != null and departmentNameLike != ''"> |
| | | and bm.meta_value like concat("%",#{departmentNameLike},"%") |
| | |
| | | <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 test="projectId != null and projectId != ''"> |
| | | and su.project_id=#{projectId} |
| | | </if> |
| | | <if test="projectName != null and projectName != ''"> |
| | | and sp.project_name like concat("%",#{projectName},"%") |
| | | </if> |
| | | order by su.arp ASC |
| | | <if test="first != null and pageSize != null"> |
| | |
| | | select |
| | | bm.meta_value AS departmentName, |
| | | bm1.meta_value AS companyName, |
| | | su.project, |
| | | su.project_id, |
| | | sp.project_name projectName, |
| | | su.arp, |
| | | su.name, |
| | | su.account, |
| | |
| | | su.phone, |
| | | su.email, |
| | | su.memo, |
| | | br. NAME AS roleName, |
| | | br.name AS roleName, |
| | | CASE WHEN su.approver_flag=0 then '否' else '是' END AS approver, |
| | | CASE WHEN su.see_flag=2 then '一般人员' WHEN su.see_flag=3 then '安全员' WHEN su.see_flag=11 then '系统管理员'WHEN su.see_flag=0 then '实验室管理员' END AS seeName, |
| | | CASE WHEN su.waster=2 then '危废管理员' WHEN su.waster=1 then '危废处理人员' else '' END AS wasterName, |
| | |
| | | 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 |
| | | left join sys_project sp on sp.id=su.project_id |
| | | <where> |
| | | su.valid_flag = 1 |
| | | <if test="arp != null and arp != ''"> |
| | |
| | | <if test="departmentName != null and departmentName != ''"> |
| | | and su.department like concat("%",#{departmentName},"%") |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | <if test="projectId != null and projectId != ''"> |
| | | and su.project_id =#{projectId} |
| | | </if> |
| | | <if test="company != null and company != ''"> |
| | | and bm1.meta_value like concat("%",#{company},"%") |