1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
| <mapper namespace="com.yuanchu.limslaboratory.mapper.UserMapper">
| <select id="selectUserByUserId" parameterType="int" resultType="Map">
| SELECT u.account account,
| u.name uname,
| u.phone,
| u.email,
| u.info,
| e.byname e_byname,
| e.`name` e_name,
| e.link_name e_link_name,
| e.link_phone e_phone
| FROM enterprise e,
| `user` u
| WHERE e.`id` = u.`enterprise_id`
| AND u.id = #{userId}
| and type = 1
| </select>
|
|
| <select id="getNewPersonnelPage" resultType="map">
| SELECT u.`id`, u.`name` username, r.`name` roleName, DATE_FORMAT(u.`create_time`, '%Y-%m-%d') createTime,
| u.`age`, CONCAT(r.`id`, '') roleId,
| u.`phone`, u.`email`, u.`job_state` jobState, o.`department`, u.`account`, o.`id` departmentId
| FROM `user` u
| LEFT JOIN role r
| ON u.`role_id` = r.`id` AND r.`state` = 1
| LEFT JOIN organizational o
| ON u.`organization_id` = o.`id` AND o.`state` = 1
| WHERE u.`state` = 1
| <if test="name != null and name != ''">
| AND u.`name` LIKE CONCAT('%',#{name}, '%')
| </if>
| <if test="status != null">
| AND u.`job_state` in (#{status})
| </if>
| and type=1
| ORDER BY u.`create_time` DESC
| </select>
|
| <select id="selectUser" resultType="Map">
| select id, name
| from lims_laboratory.user
| where job_state!=0
| and type=1
| </select>
| </mapper>
|
|