|  | @@ -2,26 +2,61 @@
 | 
	
		
			
				|  |  |  <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
	
		
			
				|  |  |  <mapper namespace="com.onemap.apply.mapper.tdgy.LandIdleConfirmMapper">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <select id="getLandIds" resultType="String">
 | 
	
		
			
				|  |  | -        SELECT td.id,td.srf,td.crmj,td.cqzh
 | 
	
		
			
				|  |  | -        from t_land_idle_confirm as confirm,tdgy_sj as td
 | 
	
		
			
				|  |  | -        WHERE confirm.land_id=td.id and is_idle=#{isConfirm}
 | 
	
		
			
				|  |  | +<!--    <select id="getIdleLandList" resultType="Map">-->
 | 
	
		
			
				|  |  | +<!--        SELECT td.id,td.srf,td.crmj,td.cqzh ,public.st_asewkt(public.st_union(tb.geom))-->
 | 
	
		
			
				|  |  | +<!--        from base.t_land_idle_confirm as confirm,vector.tdgy_sj as td,vector."TB_TDGY_SJ" as tb-->
 | 
	
		
			
				|  |  | +<!--        WHERE confirm.land_id=td.id::VARCHAR and tb.pid=td.id and is_idle=#{isConfirm}-->
 | 
	
		
			
				|  |  | +<!--        <if test="key != null and key != ''">-->
 | 
	
		
			
				|  |  | +<!--            and (td.srf like '%'||#{key}||'%' or td.cqzh like '%'||#{key}||'%')-->
 | 
	
		
			
				|  |  | +<!--        </if>-->
 | 
	
		
			
				|  |  | +<!--        <if test="xzqh != null and xzqh != ''">-->
 | 
	
		
			
				|  |  | +<!--            and td.xzqh = #{xzqh}-->
 | 
	
		
			
				|  |  | +<!--        </if>-->
 | 
	
		
			
				|  |  | +<!--        <if test="idleReason != null and idleReason != ''">-->
 | 
	
		
			
				|  |  | +<!--            and confirm.idle_reason = #{idleReason}-->
 | 
	
		
			
				|  |  | +<!--        </if>-->
 | 
	
		
			
				|  |  | +<!--        GROUP BY td.id,td.srf,td.crmj,td.cqzh-->
 | 
	
		
			
				|  |  | +<!--    </select>-->
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="getIdleLandList" resultType="Map">
 | 
	
		
			
				|  |  | +        SELECT td.id, td.srf, td.crmj, td.cqzh, public.st_asewkt(public.st_union(tb.geom))
 | 
	
		
			
				|  |  | +        FROM base.t_land_idle_confirm AS confirm
 | 
	
		
			
				|  |  | +        JOIN vector.tdgy_sj AS td ON confirm.land_id = td.id::VARCHAR
 | 
	
		
			
				|  |  | +        JOIN vector."TB_TDGY_SJ" AS tb ON tb.pid = td.id
 | 
	
		
			
				|  |  | +        WHERE confirm.is_idle = #{isConfirm}
 | 
	
		
			
				|  |  | +        <if test="key != null and key != ''">
 | 
	
		
			
				|  |  | +            AND (td.srf LIKE '%' || #{key} || '%' OR td.cqzh LIKE '%' || #{key} || '%')
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        <if test="xzqh != null and xzqh != ''">
 | 
	
		
			
				|  |  | +            AND td.xzqh = #{xzqh}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        <if test="idleReason != null and idleReason != ''">
 | 
	
		
			
				|  |  | +            AND confirm.idle_reason = #{idleReason}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        GROUP BY td.id, td.srf, td.crmj, td.cqzh
 | 
	
		
			
				|  |  | +        ORDER BY td.id
 | 
	
		
			
				|  |  | +        LIMIT #{limit} OFFSET #{offset}
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +    <select id="getIdleLandListCount" resultType="Integer">
 | 
	
		
			
				|  |  | +        SELECT COUNT(td.id)
 | 
	
		
			
				|  |  | +        FROM base.t_land_idle_confirm AS confirm
 | 
	
		
			
				|  |  | +        JOIN vector.tdgy_sj AS td ON confirm.land_id = td.id::VARCHAR
 | 
	
		
			
				|  |  | +        WHERE confirm.is_idle = #{isConfirm}
 | 
	
		
			
				|  |  |          <if test="key != null and key != ''">
 | 
	
		
			
				|  |  | -            and (td.srf like '%'||#{key}||'%' or td.cqzh like '%'||#{key}||'%')
 | 
	
		
			
				|  |  | +            AND (td.srf LIKE '%' || #{key} || '%' OR td.cqzh LIKE '%' || #{key} || '%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="xzqh != null and xzqh != ''">
 | 
	
		
			
				|  |  | -            and td.xzqh = #{xzqh}
 | 
	
		
			
				|  |  | +            AND td.xzqh = #{xzqh}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="idleReason != null and idleReason != ''">
 | 
	
		
			
				|  |  | -            and confirm.idle_reason = #{idleReason}
 | 
	
		
			
				|  |  | +            AND confirm.idle_reason = #{idleReason}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | -        limit #{limit} offset #{offset};
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -<!--    <select id="getLandGeometry" resultType="String">-->
 | 
	
		
			
				|  |  | -<!--        public.st_asewkt(public.st_union(geom))-->
 | 
	
		
			
				|  |  | -<!--        from "TB_TDGY_SJ"-->
 | 
	
		
			
				|  |  | -<!--        WHERE pid=-->
 | 
	
		
			
				|  |  | -<!--        #{pid};-->
 | 
	
		
			
				|  |  | -<!--    </select>-->
 | 
	
		
			
				|  |  | +    <!--    <select id="getLandGeometry" resultType="String">-->
 | 
	
		
			
				|  |  | +    <!--        public.st_asewkt(public.st_union(geom))-->
 | 
	
		
			
				|  |  | +    <!--        from "TB_TDGY_SJ"-->
 | 
	
		
			
				|  |  | +    <!--        WHERE pid=-->
 | 
	
		
			
				|  |  | +    <!--        #{pid};-->
 | 
	
		
			
				|  |  | +    <!--    </select>-->
 | 
	
		
			
				|  |  |  </mapper>
 |