zss
2023-07-27 0e1722e96e5483d560eda8f1cf96282955d4f224
user-server/src/main/resources/mapper/UserMapper.xml
@@ -1,13 +1,20 @@
<?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.`name`,e.link_name,e.link_phone
        from enterprise_user_list el,enterprise e,`user` u
        where e.id = el.enterprise_id
        and el.user_id = u.id
        and u.id = #{userId}
        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}
    </select>
    <resultMap id="PagePersonnelVoMap" type="com.yuanchu.limslaboratory.vo.PagePersonnelVo">
@@ -22,11 +29,16 @@
    </resultMap>
    <select id="getNewPersonnelPage" resultMap="PagePersonnelVoMap">
        SELECT u.`id`, u.`name` username, r.`name` roleName, u.`create_time`, IFNULL(u.`age`, '---') age,
               IFNULL(u.`phone`, '---') phone, IFNULL(u.`email`, '---') email, u.`job_state`
        IFNULL(u.`phone`, '---') phone, IFNULL(u.`email`, '---') email, u.`job_state`
        FROM `user` u, role r
        WHERE u.`role_id` = r.`id`
        <if test="name != null">
            AND u.name = #{name}
        </if>
    </select>
    <select id="selectUser" resultType="Map">
        select id, name
        from lims_laboratory.user
    </select>
</mapper>