zss
2024-10-30 d8ba960d180c0ad08b7dfb5a17e7ad351ca2eb62
user-server/src/main/resources/mapper/UserMapper.xml
@@ -40,8 +40,15 @@
        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
    </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>