zss
2024-09-10 22d3a8dc4185c5461bee9e42a9f4a2775ff448e6
user-server/src/main/resources/mapper/UserMapper.xml
@@ -40,8 +40,16 @@
        where state = 1
    </select>
    <select id="getCustom" resultType="com.yuanchu.mom.pojo.User">
        select u.id,c.company,u.name,c.code,u.phone from user u
        select u.id,c.company,u.name,c.code,u.phone,c.id departId from user u
        left join custom c on u.company = c.id
        where u.id = #{userId}
    </select>
    <select id="getUser" resultType="com.yuanchu.mom.pojo.User">
        select * from user where state = 1
        # where  depart_lims_id=FIND_IN_SET(depart_lims_id, (select  GROUP_CONCAT(id SEPARATOR ',') from department_lims where department_lims.name like '%实验室'))
    </select>
    <select id="selectDepartLims" resultType="java.lang.String">
        select name from department_lims
        where  id= (select  SUBSTRING_INDEX(SUBSTRING_INDEX(depart_lims_id, ',', -2), ',', 1) AS depart_lims_id  from user where name=#{prepareUser})
    </select>
</mapper>