njzscloud/njzscloud-svr/src/main/resources/mapper/route/RouteMapper.xml

52 lines
1.7 KiB
XML

<?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.njzscloud.supervisory.route.mapper.RouteMapper">
<select id="paging" resultType="com.njzscloud.supervisory.route.pojo.RouteEntity">
SELECT
a.id,
a.project_id,
a.company_id,
a.station_id,
a.name,
a.creator_id,
a.modifier_id,
a.create_time,
a.modify_time,
a.deleted,
b.company_name start_address,
c.station_name end_address,
d.project_name
FROM biz_route a
LEFT JOIN biz_company b ON b.id = a.company_id
LEFT JOIN biz_company c ON c.id = a.station_id
LEFT JOIN biz_project d ON d.id = a.project_id
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
ORDER BY a.modify_time DESC
</select>
<select id="selectDetailById" resultType="com.njzscloud.supervisory.route.pojo.RouteEntity">
SELECT a.id,
a.project_id,
a.company_id,
a.station_id,
a.name,
a.creator_id,
a.modifier_id,
a.create_time,
a.modify_time,
a.deleted,
b.company_name start_address,
c.station_name end_address,
d.project_name
FROM biz_route a
LEFT JOIN biz_company b ON b.id = a.company_id
LEFT JOIN biz_company c ON c.id = a.station_id
LEFT JOIN biz_project d ON d.id = a.project_id
WHERE a.id = #{id}
AND a.deleted = 0
</select>
</mapper>