| | |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="skPicCountMap" type="cn.gistack.sm.skPanorama.entity.SkPicCountEntity"> |
| | | <result column="guid" property="guid"/> |
| | | <result column="res_reg_code" property="resRegCode"/> |
| | | <result column="res_type" property="resType"/> |
| | | <result column="res_func" property="resFunc"/> |
| | | <result column="res_category" property="resCategory"/> |
| | | <result column="eng_scal" property="engScal"/> |
| | | <result column="picNum" property="picNum"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectSkPanoramaPage" resultMap="skPanoramaResultMap"> |
| | | <!-- |
| | | <if test="param.resGuid != null and param.resGuid != ''"> |
| | | AND t1."guid" = #{param.resGuid} |
| | | </if> |
| | | <if test="param.resRegCode != null and param.resRegCode != ''"> |
| | | AND t1."res_reg_code" = #{param.resRegCode} |
| | | </if> |
| | | --> |
| | | |
| | | <sql id="mainSql"> |
| | | select |
| | | t1."guid", |
| | | t1."res_reg_code", |
| | | t1."res_type", |
| | | t1."res_func", |
| | | t1."res_category", |
| | | t1."eng_scal" |
| | | t1."guid" AS "guid", |
| | | t1."oth_reg_cd" AS "othRegDd", |
| | | t1."res_nm" AS "resNm", |
| | | t1."city_nm" AS "city", |
| | | t1."city_cd" AS "city_cd", |
| | | t1."county_nm" AS "county", |
| | | t1."county_cd" AS "county_cd", |
| | | t1."town_nm" AS "town", |
| | | t1."town_cd" AS "town_cd", |
| | | |
| | | t2."res_type" AS "resType", |
| | | t2."res_func" AS "resFunc", |
| | | t2."res_category" AS "resCategory", |
| | | t2."eng_scal" AS "engScal", |
| | | |
| | | case |
| | | WHEN t3."picNum" is null then '0' |
| | | else t3."picNum" |
| | | end AS "picNum" |
| | | from |
| | | SJZT_MD."att_res_base" t1 |
| | | left join ( |
| | | select |
| | | res_guid, |
| | | count(res_guid) AS "num" |
| | | from |
| | | YWXT."SK_PANORAMA" |
| | | where is_deleted = 0 |
| | | group by res_guid |
| | | )t2 on t1."guid" = t2."res_guid" |
| | | where |
| | | is_deleted = 0 |
| | | SJZT_DW."dim_res_info_a" t1 |
| | | LEFT JOIN SJZT_MD."att_res_base" t2 ON t1."guid" = t2."guid" |
| | | left join ( |
| | | select |
| | | res_guid AS "resGuid", |
| | | count(res_guid) AS "picNum" |
| | | from |
| | | YWXT."SK_PANORAMA" |
| | | where is_deleted = 0 |
| | | group by res_guid |
| | | ) t3 on t1."guid" = t3."resGuid" |
| | | WHERE |
| | | t2."is_deleted" = 0 |
| | | <if test="param.havePic !=null and param.havePic==1 "> |
| | | AND t3."picNum" > 0 |
| | | </if> |
| | | <if test="param.havePic !=null and param.havePic==2 "> |
| | | AND t3."picNum" is null |
| | | </if> |
| | | <if test="param.resNm !=null and param.resNm!=''"> |
| | | AND t1."res_nm" LIKE CONCAT('%',#{param.resNm},'%') |
| | | </if> |
| | | <if test="param.guid !=null and param.guid!=''"> |
| | | AND t1."guid" = #{param.guid} |
| | | </if> |
| | | <if test="param.othRegDd !=null and param.othRegDd!=''"> |
| | | AND t1."oth_reg_cd" = #{param.othRegDd} |
| | | </if> |
| | | <if test="param.resType !=null and param.resType!=''"> |
| | | AND t2."res_type" = #{param.resType} |
| | | </if> |
| | | <if test="param.engScal !=null and param.engScal!=''"> |
| | | AND t2."eng_scal" = #{param.engScal} |
| | | </if> |
| | | <if test="param.city_cd !=null and param.cityCd!=''"> |
| | | AND t1."city_cd" = #{param.city_cd} |
| | | </if> |
| | | <if test="param.county_cd !=null and param.county_cd !=''"> |
| | | AND t1."county_cd" = #{param.county_cd} |
| | | </if> |
| | | <if test="param.town_cd !=null and param.town_cd !=''"> |
| | | AND t1."town_cd" = #{param.town_cd} |
| | | </if> |
| | | |
| | | order by t1."city_cd",t1."county_nm" |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectPageR" resultType="cn.gistack.sm.skPanorama.entity.SkPicCountEntity"> |
| | | select |
| | | * |
| | | from ( |
| | | select TMP.*, |
| | | ROWNUM as ROW_ID |
| | | from ( |
| | | <include refid="mainSql"></include> |
| | | ) TMP |
| | | where ROWNUM <![CDATA[ <= ]]> ${endIndex} |
| | | ) |
| | | where ROW_ID > ${startIndex} |
| | | </select> |
| | | |
| | | <select id="selectPageCountR" resultType="Integer"> |
| | | select |
| | | count(*) AS "countNum" |
| | | from ( |
| | | <include refid="mainSql"></include> |
| | | ) |
| | | </select> |
| | | |
| | | |
| | | |
| | | <resultMap id="skResultMap" type="cn.gistack.sm.skPanorama.entity.SkPanoramaEntity"> |
| | | <result column="id" property="id"/> |
| | | <result column="res_guid" property="resGuid"/> |