|
|
@@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="id" column="id" />
|
|
|
<result property="pathId" column="path_id" />
|
|
|
<result property="siteId" column="site_id" />
|
|
|
+ <result property="siteName" column="site_name" />
|
|
|
+ <result property="siteAddr" column="site_addr" />
|
|
|
<result property="siteOrder" column="site_order" />
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="ext1" column="ext1" />
|
|
|
@@ -15,39 +17,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectVoList" parameterType="org.dromara.system.domain.vo.TblDzbcPathSiteVo" resultMap="TblDzbcPathSiteResult">
|
|
|
- select id, path_id, site_id, site_order, remark, ext1, ext2
|
|
|
- from tbl_dzbc_path_site
|
|
|
+ select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
|
|
|
+ s.name as site_name, s.addr as site_addr
|
|
|
+ from tbl_dzbc_path_site ps
|
|
|
+ left join tbl_dzbc_site s on ps.site_id = s.id
|
|
|
<where>
|
|
|
<if test="pathId != null">
|
|
|
- and path_id = #{pathId}
|
|
|
+ and ps.path_id = #{pathId}
|
|
|
</if>
|
|
|
<if test="siteId != null">
|
|
|
- and site_id = #{siteId}
|
|
|
+ and ps.site_id = #{siteId}
|
|
|
</if>
|
|
|
</where>
|
|
|
- order by site_order asc
|
|
|
+ order by ps.site_order asc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectVoById" parameterType="Long" resultMap="TblDzbcPathSiteResult">
|
|
|
- select id, path_id, site_id, site_order, remark, ext1, ext2
|
|
|
- from tbl_dzbc_path_site
|
|
|
- where id = #{id}
|
|
|
+ select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
|
|
|
+ s.name as site_name, s.addr as site_addr
|
|
|
+ from tbl_dzbc_path_site ps
|
|
|
+ left join tbl_dzbc_site s on ps.site_id = s.id
|
|
|
+ where ps.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectVoByIds" parameterType="Collection" resultMap="TblDzbcPathSiteResult">
|
|
|
- select id, path_id, site_id, site_order, remark, ext1, ext2
|
|
|
- from tbl_dzbc_path_site
|
|
|
- where id in
|
|
|
+ select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
|
|
|
+ s.name as site_name, s.addr as site_addr
|
|
|
+ from tbl_dzbc_path_site ps
|
|
|
+ left join tbl_dzbc_site s on ps.site_id = s.id
|
|
|
+ where ps.id in
|
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByPathId" parameterType="Long" resultMap="TblDzbcPathSiteResult">
|
|
|
- select id, path_id, site_id, site_order, remark, ext1, ext2
|
|
|
- from tbl_dzbc_path_site
|
|
|
- where path_id = #{pathId}
|
|
|
- order by site_order asc
|
|
|
+ select ps.id, ps.path_id, ps.site_id, ps.site_order, ps.remark, ps.ext1, ps.ext2,
|
|
|
+ s.name as site_name, s.addr as site_addr
|
|
|
+ from tbl_dzbc_path_site ps
|
|
|
+ left join tbl_dzbc_site s on ps.site_id = s.id
|
|
|
+ where ps.path_id = #{pathId}
|
|
|
+ order by ps.site_order asc
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|