Açıklama Yok

TLhzxMaintenanceCompanyMapper.xml 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.maintenance.mapper.TLhzxMaintenanceCompanyMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
  6. <id column="id" property="id" />
  7. <result column="maintenance_company_name" property="maintenanceCompanyName" />
  8. <result column="create_user_id" property="createUserId" />
  9. <result column="create_date" property="createDate" />
  10. <result column="update_user_id" property="updateUserId" />
  11. <result column="update_date" property="updateDate" />
  12. <result column="del_flg" property="delFlg" />
  13. </resultMap>
  14. <!-- 通用查询结果列 -->
  15. <sql id="Base_Column_List">
  16. id, maintenance_company_name, owned_street, street_contact, street_contact_tel, project_manager, project_manager_tel, charge_leader, charge_leader_tel, create_user_id, create_date, update_user_id, update_date, del_flg
  17. </sql>
  18. <select id="getMaintenanceCompanyId"
  19. resultType="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
  20. select
  21. id,
  22. old_maintenance_company_id
  23. from
  24. T_Lhzx_Maintenance_Company
  25. where
  26. maintenance_company_name = #{maintenanceCompanyName}
  27. and
  28. del_flg = 0
  29. limit 1
  30. </select>
  31. <select id="selectMaintenanceCompanyBySectionId"
  32. resultType="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
  33. select
  34. *
  35. from
  36. T_Lhzx_Maintenance_Company mc
  37. where
  38. del_flg = 0
  39. <if test="maintenanceCompanyId != null">
  40. and mc.id = #{maintenanceCompanyId}
  41. </if>
  42. <if test="sectionId != null">
  43. and
  44. exists (
  45. select
  46. 1
  47. from
  48. T_Lhzx_Road_Section_Maintenance_Company
  49. where
  50. del_flg = 0
  51. and
  52. section_id = #{sectionId}
  53. and
  54. maintenance_company_id = mc.id
  55. )
  56. </if>
  57. </select>
  58. <select id="selectSectionMaintenanceCompanyList"
  59. resultType="com.yt.zhylplat.moduleLhzx.maintenance.dto.LhzxSectionMaintenanceCompanyDto">
  60. select distinct
  61. rsmc.section_id,
  62. rsmc.maintenance_company_id,
  63. mc.maintenance_company_name,
  64. s.section_name,
  65. mc.old_maintenance_company_id,
  66. s.old_section_id,
  67. rsmc.project_manager,
  68. rsmc.project_manager_tel
  69. from
  70. T_Lhzx_Road_Section_Maintenance_Company rsmc
  71. left join
  72. T_Lhzx_Maintenance_Company mc on mc.id = rsmc.maintenance_company_id
  73. left join
  74. T_Lhzx_Section s on s.id = rsmc.section_id
  75. where
  76. rsmc.del_flg = 0
  77. </select>
  78. </mapper>