暫無描述

TLhzxSectionMapper.xml 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.yt.zhylplat.moduleLhzx.section.mapper.TLhzxSectionMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.yt.zhylplat.moduleLhzx.section.entity.TLhzxSection">
  6. <id column="id" property="id" />
  7. <result column="section_name" property="sectionName" />
  8. <result column="section_type" property="sectionType" />
  9. <result column="create_user_id" property="createUserId" />
  10. <result column="create_date" property="createDate" />
  11. <result column="update_user_id" property="updateUserId" />
  12. <result column="update_date" property="updateDate" />
  13. <result column="del_flg" property="delFlg" />
  14. </resultMap>
  15. <!-- 通用查询结果列 -->
  16. <sql id="Base_Column_List">
  17. id, section_name, section_type, create_user_id, create_date, update_user_id, update_date, del_flg
  18. </sql>
  19. <select id="getSectionId" resultType="com.yt.zhylplat.moduleLhzx.section.entity.TLhzxSection">
  20. select
  21. id
  22. from
  23. T_Lhzx_Section
  24. where
  25. section_name = #{sectionName}
  26. and
  27. del_flg = 0
  28. limit 1
  29. </select>
  30. <select id="selectSectionByMaintenanceCompanyId"
  31. resultType="com.yt.zhylplat.moduleLhzx.section.entity.TLhzxSection">
  32. select
  33. *
  34. from
  35. T_Lhzx_Section s
  36. where
  37. del_flg = 0
  38. and
  39. exists(
  40. select
  41. 1
  42. from
  43. T_Lhzx_Road_Section_Maintenance_Company
  44. where
  45. del_flg = 0
  46. and
  47. section_id = s.id
  48. and
  49. maintenance_company_id = #{maintenanceCompanyId}
  50. )
  51. </select>
  52. <select id="realityEmployee" resultType="com.yt.zhylplat.moduleLhzx.employee.entity.TLhzxEmployeeSection">
  53. SELECT
  54. count(*) as sumSectionNumber
  55. FROM
  56. T_Lhzx_Employee_Section es
  57. WHERE
  58. es.del_flg = 0
  59. <if test="es.sectionId!=null">
  60. and es.section_id=#{es.sectionId}
  61. </if>
  62. GROUP BY
  63. es.section_id
  64. </select>
  65. </mapper>