| | |
| | | <select id="selectOneById" resultType="cn.gistack.by.waterdata.pojo.entity.DistanceRecord"> |
| | | select * from SJZT_ODS."water_data_distance" where "id" = #{id} |
| | | </select> |
| | | |
| | | <select id="csbldFlag" resultType="cn.gistack.by.waterdata.pojo.entity.CsbldFlag"> |
| | | SELECT |
| | | tt."res_reg_code" AS "resRegCode", |
| | | count(tt."res_reg_code") as "num", |
| | | case |
| | | when count(tt."res_reg_code") > 0 THEN 1 |
| | | ELSE 0 |
| | | END as "csbldFlag" |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ta."device_code", |
| | | tb."mn_no", |
| | | tb."code", |
| | | tc."res_reg_code", |
| | | tc."guid" |
| | | FROM |
| | | "SJZT_ODS"."water_distance_device_ex" ta |
| | | LEFT JOIN "SJZT_ODS"."water_device" tb ON ta."device_code" = tb."code" |
| | | left join "SJZT_MD"."att_res_base" tc on tc."res_reg_code" = tb."mn_no" |
| | | where |
| | | tc."guid" = #{skGuid} |
| | | )tt |
| | | GROUP by |
| | | tt."res_reg_code" |
| | | </select> |
| | | </mapper> |