| | |
| | | <?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`, |
| | | 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> |