From 5b190f997a5d04cc09f38becb5447cdf6babc473 Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期三, 19 七月 2023 15:05:55 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/hazardInvestigationSystem into zf

---
 src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml |  216 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 216 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml
index 6553580..c456458 100644
--- a/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml
+++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml
@@ -65,9 +65,18 @@
     <result column="crossy" property="crossY" jdbcType="DECIMAL" />
     <result column="issecurityofficer" property="issecurityofficer" jdbcType="TINYINT" />
     <result column="updateat" property="updateat" jdbcType="TIMESTAMP" />
+    <result column="executive_level" property="executiveLevel" jdbcType="INTEGER" />
+    <result column="province" property="province" jdbcType="VARCHAR" />
+    <result column="city" property="city" jdbcType="VARCHAR" />
+    <result column="county" property="county" jdbcType="VARCHAR" />
+    <result column="professional_level" property="professionalLevel" jdbcType="INTEGER" />
     <association property="companyInfo" javaType="com.gk.hotwork.Domain.CompanyInfo">
       <result column="company_id" property="id"  />
       <result column="company" property="company"  />
+    </association>
+    <association property="specialityInfo" javaType="com.gk.hotwork.Domain.SpecialityInfo">
+      <result column="speciality_id" property="id"  />
+      <result column="speciality_name" property="name"  />
     </association>
   </resultMap>
   <sql id="Base_Column_List" >
@@ -144,6 +153,199 @@
     </where>
   </select>
 
+  <select id="selectCompanyUserDataList" resultMap="UserVo">
+    SELECT
+    user.id,
+    user.username,
+    user.email,
+    c.company,
+    c.id company_id,
+    user.department,
+    user.job,
+    user.createdby,
+    user.createddate,
+    user.lastmodifiedby,
+    user.lastmodifieddate,
+    user.status,
+    user.expiredate,
+    user.isdel,
+    user.type,
+    user.realname,
+    user.idcard,
+    user.iscompany,
+    user.isdepartment,
+    user.isupload,
+    user.empno,
+    user.deviceno,
+    user.cardid,
+    user.crossx,
+    user.crossy,
+    user.updateat,
+    user.issecurityofficer,
+    user.province,
+    user.city,
+    user.county,
+    user.executive_level
+    FROM
+    `user` as user
+    left join company as c on c.id = user.companyid
+    left join userroles as r on r.userid = `user`.id
+    <where>
+        `user`.status = 1
+        and  user.type = 3
+      <if test="record.username != null and record.username !=''">
+        and user.username like concat ('%',#{record.username,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.realname != null and record.realname !=''">
+        and user.realname like concat ('%',#{record.realname,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.company != null and record.company !=''">
+        and c.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.job != null and record.job !=''">
+        and user.job like concat ('%',#{record.job,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.roleId != null">
+        and r.roleid = #{record.roleId}
+      </if>
+    </where>
+  </select>
+  <select id="selectSuperviseUserDataList" resultMap="UserVo">
+    SELECT
+    user.id,
+    user.username,
+    user.email,
+    user.company,
+    c.id company_id,
+    user.department,
+    user.job,
+    user.createdby,
+    user.createddate,
+    user.lastmodifiedby,
+    user.lastmodifieddate,
+    user.status,
+    user.expiredate,
+    user.isdel,
+    user.type,
+    user.realname,
+    user.idcard,
+    user.iscompany,
+    user.isdepartment,
+    user.isupload,
+    user.empno,
+    user.deviceno,
+    user.cardid,
+    user.crossx,
+    user.crossy,
+    user.updateat,
+    user.issecurityofficer,
+    user.province,
+    user.city,
+    user.county,
+    user.executive_level
+    FROM
+    `user` as user
+    left join company as c on c.id = user.companyid
+    left join userroles as r on r.userid = `user`.id
+    <where>
+      `user`.status = 1
+      and  user.type = 2
+      <if test="record.username != null and record.username !=''">
+        and user.username like concat ('%',#{record.username,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.realname != null and record.realname !=''">
+        and user.realname like concat ('%',#{record.realname,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.company != null and record.company !=''">
+        and user.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.job != null and record.job !=''">
+        and user.job like concat ('%',#{record.job,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.roleId != null">
+        and r.roleid = #{record.roleId}
+      </if>
+      <if test="record.province != null and record.province !=''">
+        and user.province = #{record.province}
+      </if>
+      <if test="record.city != null and record.city !=''">
+        and user.city = #{record.city}
+      </if>
+      <if test="record.county != null and record.county !=''">
+        and user.county = #{record.county}
+      </if>
+    </where>
+  </select>
+  <select id="selectExpertUserDataList" resultMap="UserVo">
+    SELECT
+    user.id,
+    user.username,
+    user.email,
+    user.company,
+    c.id company_id,
+    user.department,
+    user.job,
+    user.createdby,
+    user.createddate,
+    user.lastmodifiedby,
+    user.lastmodifieddate,
+    user.status,
+    user.expiredate,
+    user.isdel,
+    user.type,
+    user.realname,
+    user.idcard,
+    user.iscompany,
+    user.isdepartment,
+    user.isupload,
+    user.empno,
+    user.deviceno,
+    user.cardid,
+    user.crossx,
+    user.crossy,
+    user.updateat,
+    user.issecurityofficer,
+    user.province,
+    user.city,
+    user.county,
+    user.executive_level,
+    user.professional_level,
+    user.speciality_id,
+    s.name as speciality_name
+    FROM
+    `user` as user
+    left join company as c on c.id = user.companyid
+    left join userroles as r on r.userid = `user`.id
+    left join speciality as s on s.id = `user`.speciality_id
+    <where>
+      `user`.status = 1
+      and  user.type = 4
+      <if test="record.username != null and record.username !=''">
+        and user.username like concat ('%',#{record.username,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.realname != null and record.realname !=''">
+        and user.realname like concat ('%',#{record.realname,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.company != null and record.company !=''">
+        and user.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.job != null and record.job !=''">
+        and user.job like concat ('%',#{record.job,jdbcType=VARCHAR},'%')
+      </if>
+      <if test="record.roleId != null">
+        and r.roleid = #{record.roleId}
+      </if>
+      <if test="record.province != null and record.province !=''">
+        and user.province = #{record.province}
+      </if>
+      <if test="record.city != null and record.city !=''">
+        and user.city = #{record.city}
+      </if>
+      <if test="record.county != null and record.county !=''">
+        and user.county = #{record.county}
+      </if>
+    </where>
+  </select>
   <select id="selectUserInfo" resultType="com.gk.hotwork.Domain.UserInfo">
     select user.*,d.department departmentname
     from user as user
@@ -348,4 +550,18 @@
     select * from user where id = #{userId}
   </select>
 
+  <select id="selectExpertList" resultType="com.gk.hotwork.Domain.UserInfo">
+    select u.id,u.realname
+    from user u
+    left join userroles r on r.userid = u.id
+    where
+        u.status = 1
+      and u.type != 1
+    and r.roleid = 36
+    <if test="realname != null and realname != ''">
+      u.realname  like concat("%",#{realname},"%")
+    </if>
+
+  </select>
+
 </mapper>

--
Gitblit v1.9.2