| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yt.zhylplat.moduleLhzx.maintenance.mapper.TLhzxMaintenanceCompanyMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
- <id column="id" property="id" />
- <result column="maintenance_company_name" property="maintenanceCompanyName" />
- <result column="create_user_id" property="createUserId" />
- <result column="create_date" property="createDate" />
- <result column="update_user_id" property="updateUserId" />
- <result column="update_date" property="updateDate" />
- <result column="del_flg" property="delFlg" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- 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
- </sql>
- <select id="getMaintenanceCompanyId"
- resultType="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
- select
- id,
- old_maintenance_company_id
- from
- T_Lhzx_Maintenance_Company
- where
- maintenance_company_name = #{maintenanceCompanyName}
- and
- del_flg = 0
- limit 1
- </select>
- <select id="selectMaintenanceCompanyBySectionId"
- resultType="com.yt.zhylplat.moduleLhzx.maintenance.entity.TLhzxMaintenanceCompany">
- select
- *
- from
- T_Lhzx_Maintenance_Company mc
- where
- del_flg = 0
- <if test="maintenanceCompanyId != null">
- and mc.id = #{maintenanceCompanyId}
- </if>
- <if test="sectionId != null">
- and
- exists (
- select
- 1
- from
- T_Lhzx_Road_Section_Maintenance_Company
- where
- del_flg = 0
- and
- section_id = #{sectionId}
- and
- maintenance_company_id = mc.id
- )
- </if>
- </select>
- <select id="selectSectionMaintenanceCompanyList"
- resultType="com.yt.zhylplat.moduleLhzx.maintenance.dto.LhzxSectionMaintenanceCompanyDto">
- select distinct
- rsmc.section_id,
- rsmc.maintenance_company_id,
- mc.maintenance_company_name,
- s.section_name,
- mc.old_maintenance_company_id,
- s.old_section_id,
- rsmc.project_manager,
- rsmc.project_manager_tel
- from
- T_Lhzx_Road_Section_Maintenance_Company rsmc
- left join
- T_Lhzx_Maintenance_Company mc on mc.id = rsmc.maintenance_company_id
- left join
- T_Lhzx_Section s on s.id = rsmc.section_id
- where
- rsmc.del_flg = 0
- </select>
- </mapper>
|