新乡12356心理咨询热线

MainProblemMapper.xml 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="api.mapper.system.MainProblemMapper">
  6. <select id="selectWorkroderType" resultType="Long" resultSets="api.entity.database.system.MainProblem">
  7. select *
  8. -- (SELECT
  9. -- GROUP_CONCAT(b.`type_name` SEPARATOR '/') from workorder_type b where FIND_IN_SET(b.id,CONCAT( a.ancestors,',',a.id)) ) ancestorsName
  10. FROM workorder_type a where a.is_delete=0
  11. <if test="id >0 ">
  12. and a.id=#{id}
  13. </if>
  14. order by a.id
  15. </select>
  16. <select id="selectWorkroderTypeById" resultType="Long" resultSets="api.entity.database.system.MainProblem">
  17. select *
  18. -- ,
  19. -- (SELECT
  20. -- GROUP_CONCAT(b.`type_name` SEPARATOR '/') from workorder_type b where FIND_IN_SET(b.id,CONCAT( a.ancestors,',',a.id)) ) ancestorsName
  21. FROM workorder_type a where a.is_delete=0 and a.id=#{id}
  22. order by a.id
  23. </select>
  24. </mapper>