| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775 |
- <?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="cn.com.goldenwater.dcproj.dao.AttAdXBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttAdXBase" id="attAdXBaseResultMap">
- <result property="isPoveryt" column="IS_POVERYT"/>
- <result property="src" column="SRC"/>
- <result property="remark" column="REMARK"/>
- <result property="guid" column="GUID"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="lowLeftLong" column="LOW_LEFT_LONG"/>
- <result property="lowLeftLat" column="LOW_LEFT_LAT"/>
- <result property="upRightLong" column="UP_RIGHT_LONG"/>
- <result property="upRightLat" column="UP_RIGHT_LAT"/>
- <result property="upAdName" column="UP_AD_NAME"/>
- <result property="adGrad" column="AD_GRAD"/>
- <result property="adAbbrName" column="AD_ABBR_NAME"/>
- <result property="adStat" column="AD_STAT"/>
- <result property="adArea" column="AD_AREA"/>
- <result property="adFullName" column="AD_FULL_NAME"/>
- <result property="note" column="NOTE"/>
- <result property="effDate" column="EFF_DATE"/>
- <result property="exprDate" column="EXPR_DATE"/>
- <result property="adStatLong" column="AD_STAT_LONG"/>
- <result property="adStatLat" column="AD_STAT_LAT"/>
- <result property="domainCode" column="DOMAIN_CODE"/>
- <result property="adSign" column="AD_SIGN"/>
- <result property="modifierPeople" column="MODIFIER_PEOPLE"/>
- <result property="updDate" column="UPD_DATE"/>
- <result property="isReport" column="IS_REPORT"/>
- <result property="adFcode" column="AD_FCODE"/>
- <result property="lgtd" column="LGTD"/>
- <result property="lttd" column="LTTD"/>
- <result property="lgtdpc" column="LGTDPC"/>
- <result property="lttdpc" column="LTTDPC"/>
- </resultMap>
- <sql id="table_columns">
- IS_POVERYT ,
- SRC ,
- REMARK ,
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- GUID ,
- AD_CODE ,
- AD_NAME ,
- LOW_LEFT_LONG ,
- LOW_LEFT_LAT ,
- UP_RIGHT_LONG ,
- UP_RIGHT_LAT ,
- UP_AD_NAME ,
- AD_GRAD ,
- AD_ABBR_NAME ,
- AD_STAT ,
- AD_AREA ,
- AD_FULL_NAME ,
- NOTE ,
- DATE_FORMAT(EFF_DATE,'%Y-%m-%d %T') EFF_DATE,
- DATE_FORMAT(EXPR_DATE,'%Y-%m-%d %T') EXPR_DATE,
- AD_STAT_LONG ,
- AD_STAT_LAT ,
- DOMAIN_CODE ,
- AD_SIGN ,
- MODIFIER_PEOPLE ,
- DATE_FORMAT(UPD_DATE,'%Y-%m-%d %T') UPD_DATE,
- IS_REPORT ,
- AD_FCODE
- </sql>
- <sql id="table_columns2">
- IS_POVERYT ,
- SRC ,
- REMARK ,
- LGTD ,
- LTTD ,
- LGTDPC ,
- LTTDPC ,
- GUID ,
- AD_CODE ,
- AD_NAME ,
- LOW_LEFT_LONG ,
- LOW_LEFT_LAT ,
- UP_RIGHT_LONG ,
- UP_RIGHT_LAT ,
- UP_AD_NAME ,
- AD_GRAD ,
- AD_ABBR_NAME ,
- AD_STAT ,
- AD_AREA ,
- AD_FULL_NAME ,
- NOTE ,
- EFF_DATE ,
- EXPR_DATE ,
- AD_STAT_LONG ,
- AD_STAT_LAT ,
- DOMAIN_CODE ,
- AD_SIGN ,
- MODIFIER_PEOPLE ,
- UPD_DATE ,
- IS_REPORT ,
- AD_FCODE
- </sql>
- <sql id="entity_properties">
- #{isPoveryt},
- #{src},
- #{remark},
- #{lgtd},
- #{lttd},
- #{lgtdpc},
- #{lttdpc},
- #{guid},
- #{adCode},
- #{adName},
- #{lowLeftLong},
- #{lowLeftLat},
- #{upRightLong},
- #{upRightLat},
- #{upAdName},
- #{adGrad},
- #{adAbbrName},
- #{adStat},
- #{adArea},
- #{adFullName},
- #{note},
- STR_TO_DATE(#{effDate},'%Y-%m-%d %T') ,
- STR_TO_DATE(#{exprDate},'%Y-%m-%d %T') ,
- #{adStatLong},
- #{adStatLat},
- #{domainCode},
- #{adSign},
- #{modifierPeople},
- STR_TO_DATE(#{updDate},'%Y-%m-%d %T') ,
- #{isReport},
- #{adFcode}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="isPoveryt == '1'.toString() or isPoveryt == '0'.toString()">and IS_POVERYT = #{isPoveryt}</if>
- <if test="isPoveryt == '2'.toString()">and IS_POVERYT IS NULL</if>
- <if test="src != null and src != ''">and SRC = #{src}</if>
- <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
- <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
- <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
- <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC = #{lgtdpc}</if>
- <if test="lttdpc != null and lttdpc != ''">and LTTDPC = #{lttdpc}</if>
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE like concat(#{adCode},'%')</if>
- <if test="adName != null and adName != ''">and AD_NAME LIKE concat('%',#{adName},'%')</if>
- <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG = #{lowLeftLong}</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT = #{lowLeftLat}</if>
- <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG = #{upRightLong}</if>
- <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT = #{upRightLat}</if>
- <if test="upAdName != null and upAdName != ''">and UP_AD_NAME LIKE concat('%',#{upAdName},'%')</if>
- <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
- <if test="adAbbrName != null and adAbbrName != ''">and AD_ABBR_NAME LIKE concat('%',#{adAbbrName},'%')</if>
- <if test="adStat != null and adStat != ''">and AD_STAT = #{adStat}</if>
- <if test="adArea != null and adArea != ''">and AD_AREA = #{adArea}</if>
- <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME LIKE concat('%',#{adFullName},'%')</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="effDate != null and effDate != ''">and DATE_FORMAT(EFF_DATE,'%Y-%m-%d %T') = DATE_FORMAT(STR_TO_DATE(#{effDate},'%Y-%m-%d %T') ,'%Y-%m-%d %T')</if>
- <if test="exprDate != null and exprDate != ''">and DATE_FORMAT(EXPR_DATE,'%Y-%m-%d %T') = DATE_FORMAT( STR_TO_DATE(#{exprDate},'%Y-%m-%d %T'), '%Y-%m-%d %T')
- </if>
- <if test="adStatLong != null and adStatLong != ''">and AD_STAT_LONG = #{adStatLong}</if>
- <if test="adStatLat != null and adStatLat != ''">and AD_STAT_LAT = #{adStatLat}</if>
- <if test="domainCode != null and domainCode != ''">and DOMAIN_CODE = #{domainCode}</if>
- <if test="adSign != null and adSign != ''">and AD_SIGN = #{adSign}</if>
- <if test="modifierPeople != null and modifierPeople != ''">and MODIFIER_PEOPLE = #{modifierPeople}</if>
- <if test="updDate != null and updDate != ''">and DATE_FORMAT(UPD_DATE,'%Y-%m-%d %T') = DATE_FORMAT(STR_TO_DATE(#{updDate},'%Y-%m-%d %T'), '%Y-%m-%d %T')</if>
- <if test="isReport != null and isReport != ''">and IS_REPORT = #{isReport}</if>
- <if test="adFcode != null and adFcode != ''">and AD_FCODE = #{adFcode}</if>
- <if test="province != null and province != ''">and AD_CODE like '${province}%'</if>
- AND EXPR_DATE IS NULL
- </trim>
- </sql>
- <select id="get" resultMap="attAdXBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_AD_X_BASE where AD_CODE = #{id}
- </select>
- <select id="getBy" resultMap="attAdXBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_AD_X_BASE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attAdXBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_AD_X_BASE
- </select>
- <select id="findList" resultMap="attAdXBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_AD_X_BASE
- <include refid="page_where"/>
- order by UPD_DATE DESC,AD_CODE
- </select>
- <select id="selectCount" resultType="int">
- select count(GUID) from ATT_AD_X_BASE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- insert into ATT_AD_X_BASE(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_AD_X_BASE where GUID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- delete from ATT_AD_X_BASE
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_AD_X_BASE set flag_valid = 0 where GUID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- update ATT_AD_X_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="isPoveryt != null and isPoveryt != ''">IS_POVERYT = #{isPoveryt},</if>
- <if test="src != null and src != ''">SRC = #{src},</if>
- <if test="remark != null and remark != ''">REMARK = #{remark},</if>
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
- <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
- <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
- <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
- <if test="upAdName != null and upAdName != ''">UP_AD_NAME = #{upAdName},</if>
- <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
- <if test="adAbbrName != null and adAbbrName != ''">AD_ABBR_NAME = #{adAbbrName},</if>
- <if test="adStat != null and adStat != ''">AD_STAT = #{adStat},</if>
- <if test="adArea != null and adArea != ''">AD_AREA = #{adArea},</if>
- <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null and effDate != ''">EFF_DATE = STR_TO_DATE(#{effDate},'%Y-%m-%d %T'),</if>
- <if test="exprDate != null and exprDate != ''">EXPR_DATE = STR_TO_DATE(#{exprDate},'%Y-%m-%d %T'),
- </if>
- <if test="adStatLong != null and adStatLong != ''">AD_STAT_LONG = #{adStatLong},</if>
- <if test="adStatLat != null and adStatLat != ''">AD_STAT_LAT = #{adStatLat},</if>
- <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
- <if test="adSign != null and adSign != ''">AD_SIGN = #{adSign},</if>
- <if test="modifierPeople != null and modifierPeople != ''">MODIFIER_PEOPLE = #{modifierPeople},</if>
- <if test="updDate != null and updDate != ''">UPD_DATE = STR_TO_DATE(#{updDate},'%Y-%m-%d %T'),</if>
- <if test="isReport != null and isReport != ''">IS_REPORT = #{isReport},</if>
- <if test="adFcode != null and adFcode != ''">AD_FCODE = #{adFcode},</if>
- </trim>
- <where>GUID = #{guid}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- update ATT_AD_X_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="isPoveryt != null and isPoveryt != ''">IS_POVERYT = #{isPoveryt},</if>
- <if test="src != null and src != ''">SRC = #{src},</if>
- <if test="remark != null and remark != ''">REMARK = #{remark},</if>
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
- <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
- <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
- <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
- <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
- <if test="upAdName != null and upAdName != ''">UP_AD_NAME = #{upAdName},</if>
- <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
- <if test="adAbbrName != null and adAbbrName != ''">AD_ABBR_NAME = #{adAbbrName},</if>
- <if test="adStat != null and adStat != ''">AD_STAT = #{adStat},</if>
- <if test="adArea != null and adArea != ''">AD_AREA = #{adArea},</if>
- <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="effDate != null and effDate != ''">EFF_DATE = STR_TO_DATE(#{effDate},'%Y-%m-%d %T'),</if>
- <if test="exprDate != null and exprDate != ''">EXPR_DATE = STR_TO_DATE(#{exprDate},'%Y-%m-%d %T'), </if>
- <if test="adStatLong != null and adStatLong != ''">AD_STAT_LONG = #{adStatLong},</if>
- <if test="adStatLat != null and adStatLat != ''">AD_STAT_LAT = #{adStatLat},</if>
- <if test="domainCode != null and domainCode != ''">DOMAIN_CODE = #{domainCode},</if>
- <if test="adSign != null and adSign != ''">AD_SIGN = #{adSign},</if>
- <if test="modifierPeople != null and modifierPeople != ''">MODIFIER_PEOPLE = #{modifierPeople},</if>
- <if test="updDate != null and updDate != ''">UPD_DATE = STR_TO_DATE(#{updDate},'%Y-%m-%d %T'),</if>
- <if test="isReport != null and isReport != ''">IS_REPORT = #{isReport},</if>
- <if test="adFcode != null and adFcode != ''">AD_FCODE = #{adFcode},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 使用like用法:columnName like '%'||#{columnName}||'%' -->
- <sql id="page_where_extend">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="isPoveryt != null and isPoveryt != ''">
- <choose>
- <when test="isPoveryt == 1">
- and IS_POVERYT = '1'
- </when>
- <otherwise>
- and IS_POVERYT is null or is_poveryt != '1'
- </otherwise>
- </choose>
- </if>
- <if test="src != null and src != ''">and SRC like CONCAT('%', #{src}, '%')</if>
- <if test="remark != null and remark != ''">and REMARK like CONCAT('%', #{remark}, '%')</if>
- <if test="lgtd != null and lgtd != ''">and LGTD like CONCAT('%', #{lgtd}, '%')</if>
- <if test="lttd != null and lttd != ''">and LTTD like CONCAT('%', #{lttd}, '%')</if>
- <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC like CONCAT('%', #{lgtdpc}, '%')</if>
- <if test="lttdpc != null and lttdpc != ''">and LTTDPC like CONCAT('%', #{lttdpc}, '%')</if>
- <if test="guid != null and guid != ''">and GUID like CONCAT('%', #{guid}, '%')</if>
- <if test="adCode != null and adCode != ''">and AD_CODE like CONCAT(#{adCode}, '%')</if>
- <if test="adName != null and adName != ''">
- and (AD_NAME LIKE CONCAT('%', #{adName}, '%') OR AD_CODE LIKE CONCAT(#{adName}, '%') )
- </if>
- <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG like CONCAT('%', #{lowLeftLong},'%')
- </if>
- <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT like CONCAT('%', #{lowLeftLat}, '%')
- </if>
- <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG like CONCAT('%', #{upRightLong},'%')
- </if>
- <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT like CONCAT('%', #{upRightLat}, '%')
- </if>
- <if test="upAdName != null and upAdName != ''">and UP_AD_NAME LIKE CONCAT('%', #{upAdName}, '%')</if>
- <if test="adGrad != null and adGrad != ''">
- and instr(#{adGrad},AD_GRAD) > 0
- </if>
- <if test="adAbbrName != null and adAbbrName != ''">and AD_ABBR_NAME LIKE CONCAT('%', #{adAbbrName}, '%')
- </if>
- <if test="adStat != null and adStat != ''">and AD_STAT like CONCAT('%', #{adStat}, '%')</if>
- <if test="adArea != null and adArea != ''">and AD_AREA like CONCAT('%', #{adArea}, '%')</if>
- <if test="adFullName != null and adFullName != ''">and AD_FULL_NAMELIKE CONCAT('%', #{adFullName}, '%')</if>
- <if test="note != null and note != ''">and NOTE like CONCAT('%', #{note}, '%')</if>
- <if test="effDate != null and effDate != ''">and EFF_DATE = STR_TO_DATE(#{effDate} ,'%Y-%m-%d %T')
- </if>
- <if test="exprDate != null and exprDate != ''">and EXPR_DATE = STR_TO_DATE(#{exprDate} ,'%Y-%m-%d %T')
- </if>
- <if test="adStatLong != null and adStatLong != ''">and AD_STAT_LONG like CONCAT('%', #{adStatLong}, '%')
- </if>
- <if test="adStatLat != null and adStatLat != ''">and AD_STAT_LAT like CONCAT('%', #{adStatLat}, '%')</if>
- <if test="domainCode != null and domainCode != ''">and DOMAIN_CODE like CONCAT('%', #{domainCode}, '%')</if>
- <if test="adSign != null and adSign != ''">and AD_SIGN like CONCAT('%', #{adSign}, '%')</if>
- <if test="modifierPeople != null and modifierPeople != ''">and MODIFIER_PEOPLE like
- CONCAT('%', #{modifierPeople}, '%')
- </if>
- <if test="updDate != null and updDate != ''">and UPD_DATE = STR_TO_DATE(#{updDate}, '%Y-%m-%d %T')
- </if>
- <if test="isReport != null and isReport != ''">and IS_REPORT like CONCAT('%', #{isReport}, '%')</if>
- <if test="adFcode != null and adFcode != ''">and AD_FCODE like CONCAT('%', #{adFcode}, '%')</if>
- <if test="province != null and province != ''">and AD_CODE LIKE CONCAT(#{province}, '%')</if>
- AND EXPR_DATE IS NULL
- </trim>
- </sql>
- <!--获取行政区划列表-->
- <select id="getTableList" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select * from ATT_AD_X_BASE
- <include refid="page_where_extend"></include>
- order by AD_GRAD asc,AD_CODE asc
- </select>
- <select id="getByCode" resultMap="attAdXBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_AD_X_BASE where ad_code=#{adCode}
- </select>
- <select id="getMaxVillageCode" resultType="string" parameterType="string">
- SELECT MAX(AD_CODE) FROM ATT_AD_X_BASE WHERE AD_FCODE=#{adCode}
- </select>
- <select id="getDcVillNum" resultType="int" parameterType="string">
- SELECT SUM(NUM) FROM(
- select count(vill_id) NUM from BIS_INSP_SECSURVEY_VLG where eng_id=#{engId} and village_code=#{adCode}
- union all
- select count(RUNSTSE_ID) NUM from BIS_INSP_VLGDRINK_FAC_OPER where eng_id=#{engId} and ad_code=#{adCode}
- UNION ALL
- select count(PRSN_WATER_ID) NUM from BIS_INSP_WATERUSER_INFO where eng_id=#{engId} and village_code=#{adCode}
- )
- </select>
- <select id="queryTCListLast" parameterType="cn.com.goldenwater.dcproj.param.QueryTCListParam"
- resultType="cn.com.goldenwater.dcproj.model.TCListBean">
- SELECT TOWN_CODE,
- TOWN_NAME,
- VILL_CODE,
- VILL_NAME,
- VILL_ID,
- TOWN_ID,
- LGTD,
- LTTD,
- LGTDPC,
- LTTDPC,
- STATUS,
- CASE WHEN IS_POVERYT IS NULL THEN '2' ELSE IS_POVERYT END IS_POVERYT
- FROM (SELECT B.AD_CODE TOWN_CODE,
- B.AD_NAME TOWN_NAME,
- A.AD_CODE VILL_CODE,
- A.AD_NAME VILL_NAME,
- A.guid VILL_ID,
- B.GUID TOWN_ID,
- A.LGTD,
- A.LTTD,
- A.LGTDPC,
- A.LTTDPC,
- CASE WHEN NUM IS NULL THEN 0 ELSE 1 END STATUS,
- CASE WHEN D.IS_POVERTY IS NULL THEN A.IS_POVERYT ELSE D.IS_POVERTY END IS_POVERYT
- FROM att_ad_x_base A
- LEFT JOIN att_ad_x_base B
- ON A.AD_FCODE = B.AD_CODE
- LEFT JOIN ( SELECT SUM(s.NUM) NUM,s.AD_CODE FROM(
- select count(vill_id) NUM,village_code AD_CODE from BIS_INSP_SECSURVEY_VLG where eng_id=#{engId} GROUP BY
- village_code
- union all
- select count(RUNSTSE_ID) NUM,AD_CODE from BIS_INSP_VLGDRINK_FAC_OPER where eng_id=#{engId} GROUP BY AD_CODE
- UNION ALL
- select count(PRSN_WATER_ID) NUM,village_code AD_CODE from BIS_INSP_WATERUSER_INFO where eng_id=#{engId} GROUP BY
- village_code
- ) s GROUP BY s.AD_CODE) C ON A.AD_CODE=C.AD_CODE
- LEFT JOIN BIS_INSP_SECSURVEY_VLG D ON A.AD_CODE=D.VILLAGE_CODE AND D.ENG_ID=#{engId}
- WHERE B.AD_FCODE = #{adCode}
- <if test='name != null and name != "" '>
- AND( A.AD_NAME LIKE concat('%',#{name},'%') OR B.AD_NAME LIKE concat('%',#{name},'%') )
- </if>
- ORDER BY B.AD_CODE ,STATUS DESC,A.AD_CODE
- ) w WHERE 1=1
- <if test="isPoveryt == '0'.toString() or isPoveryt == '1'.toString()">and w.IS_POVERYT =#{isPoveryt}</if>
- <if test="isPoveryt == '2'.toString() ">and w.IS_POVERYT IS NULL</if>
- </select>
- <!--示例参数 001,002-->
- <select id="getTargetAdByNodeId" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select DISTINCT t.*
- from ATT_AD_X_BASE t
- left join ATT_RS_BASE b
- on t.ad_code = b.adm_div
- left join BIS_INSP_ALL_OBJ o
- on b.rs_code = o.code
- WHERE 1 = 1
- and o.ptype = 1
- AND
- REGEXP_LIKE(
- o.Id,concat('^(',
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid})>0 then
- (SELECT group_concat(id separator '|') as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid} GROUP BY PERSID)
- else (select 'non' from dual) end)
- ,')'))
- <if test="nodes != null and nodes != ''">
- AND
- <foreach collection="nodes" index="index" item="item" separator="or">
- o.id like CONCAT(#{item},'%')
- </foreach>
- </if>
- ORDER BY t.AD_CODE ASC
- </select>
- <select id="getAllNodeByPid" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
- SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE
- where AD_CODE like concat(replace(replace(replace(#{pid},'0000000000',''),'00000000',''),'000000',''), '%')
- <if test="lev != null and lev != ''">
- AND CAST(ad_grad AS SIGNED)<=#{lev}
- </if>
- order by AD_GRAD asc , AD_CODE asc
- </select>
- <select id="getAllNodeByPids" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
- SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE where 1=1
- <if test='adCdS != null and adCdS != ""'>
- AND AD_CODE in
- <foreach collection="adCdS.split(',')" index="index" item="item" separator="," open="(" close=")">
- #{item}
- </foreach>
- </if>
- <if test='level != null and level != ""'>
- AND AD_GRAD = #{level}
- </if>
- </select>
- <select id="getAllNodeByIds" resultType="cn.com.goldenwater.dcproj.model.AttAdXBaseNode">
- SELECT AD_CODE AS ID,AD_NAME AS NM,AD_FCODE AS PID, AD_GRAD AS "LEVEL" FROM ATT_AD_X_BASE where AD_FCODE = #{id}
- </select>
- <select id="getByName" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase"
- parameterType="cn.com.goldenwater.dcproj.param.AttAdXBaseParam">
- select * from Att_ad_x_base t where t.ad_name = #{adName}
- <if test="adCode != null and adCode != ''">
- and t.AD_CODE LIKE '${adCode}%'
- </if>
- </select>
- <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
- resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- SELECT A.* ,B.OBJ_ID,B.ID groupId,C.ID rgstrId FROM ATT_AD_X_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.ad_code =
- B.CODE
- <if test="objType=='14'.toString()">
- LEFT JOIN BIS_INSP_WINT_RGSTR C ON B.OBJ_ID = C.OBJ_ID
- </if>
- <if test="objType=='15'.toString()">
- LEFT JOIN BIS_INSP_SVWT_AREA_RGSTR C ON B.OBJ_ID = C.OBJ_ID
- </if>
- WHERE B.PTYPE = #{objType} AND
- REGEXP_LIKE(
- B.Id,concat('^(',
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid})>0 then
- (SELECT group_concat(id separator '|') as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid} GROUP BY PERSID)
- else (select 'non' from dual) end)
- ,')'))
- <choose>
- <when test="province !=null and province !=''">
- and B.AD_CODE =#{province}
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- <if test="adName != null and adName != ''">and A.SWHS_NAME LIKE '%${adName}%'</if>
- <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
- </select>
- <select id="getObjListNotInspGroupId" parameterType="String"
- resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select t.*
- from ATT_AD_X_BASE t
- where t.guid not in (
- select CODE from BIS_INSP_ALL_OBJ B where id like concat(#{inspGroupId},'%') and B.obj_type=#{objType}
- <choose>
- <when test="province !=null and province !=''">
- and B.AD_CODE =#{province}
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- )
- <if test="adName != null and adName != ''">and t.nm LIKE '%${adName}%'</if>
- <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
- </select>
- <select id="findXZCZhenList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- SELECT E.AD_CODE,E.AD_NAME FROM ATT_AD_X_BASE E
- WHERE E.AD_CODE LIKE '${adCode}___000%'
- and substr(e.ad_code,7)!='000000'
- </select>
- <select id="findXZCCunList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- SELECT
- E.AD_CODE,E.AD_NAME,(CASE WHEN E.IS_POVERYT IS NULL THEN '0' ELSE E.IS_POVERYT END) IS_POVERYT
- FROM ATT_AD_X_BASE E
- WHERE
- E.AD_CODE LIKE '${adCode}%'
- and substr(e.ad_code,10)!='000'
- and e.ad_code not in (
- <choose>
- <when test="type=='25'.toString()">
- select ad_code from BIS_NEW_DCUSER_REL_VILL l where l.regstr_id=#{rgstrId}
- </when>
- <when test="type=='71'.toString()">
- SELECT VILL_CODE FROM BIS_INSP_VILLQH_RGSTR_REL_VILL L WHERE L.REGSTR_ID = #{rgstrId} AND L.DATA_STAT = '0'
- </when>
- <when test="type=='97'.toString()">
- SELECT AD_CODE FROM BIS_INSP_VILL2021_VILL L WHERE L.RGSTR_ID = #{rgstrId} AND L.DATA_STAT = '0'
- </when>
- <otherwise>
- select ad_code from BIS_ZHEJIANG_DCUSER_REL_VILL l where l.rgstr_id=#{rgstrId}
- </otherwise>
- </choose>
- )
- order by e.ad_code asc
- </select>
- <select id="findCunList" resultType="cn.com.goldenwater.dcproj.model.BisZhejiangDcuserRelVill"
- parameterType="String">
- select * from
- <choose>
- <when test="type=='41'.toString()">
- BIS_ZHEJIANG_DCUSER_REL_VILL
- where ad_code like '${adCode}%'
- and rgstr_id=#{rgstrId}
- order by ad_code
- </when>
- <when test="type=='71'.toString()">
- BIS_INSP_VILLQH_RGSTR_REL_VILL
- where DATA_STAT = '0'
- AND ad_code like '${adCode}%'
- and REGSTR_ID =#{rgstrId}
- order by ad_code
- </when>
- <when test="type=='97'.toString()">
- (
- SELECT
- V.*, A.AD_NAME AS TOWN_NAME
- FROM BIS_INSP_VILL2021_VILL V
- LEFT JOIN ATT_AD_X_BASE A ON A.AD_CODE = concat(SUBSTR(V.AD_CODE, 1, 9) , '000')
- )
- where DATA_STAT = '0'
- AND ad_code like '${adCode}%'
- and RGSTR_ID =#{rgstrId}
- order by ad_code
- </when>
- <otherwise>
- BIS_NEW_DCUSER_REL_VILL
- where ad_code like '${adCode}%'
- and regstr_id=#{rgstrId}
- order by ad_code
- </otherwise>
- </choose>
- </select>
- <select id="getAdData" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select guid,
- ad_code,
- ad_name,
- low_left_long,
- low_left_lat,
- up_right_long,
- up_right_lat,
- up_ad_name,
- ad_grad,
- ad_abbr_name,
- ad_stat,
- ad_area,
- ad_full_name,
- note,
- eff_date,
- expr_date,
- ad_stat_long,
- ad_stat_lat,
- domain_code,
- ad_sign,
- modifier_people,
- upd_date,
- is_report,
- ad_fcode,lgtd,lttd from att_ad_x_base WHERE AD_FCODE = #{adCode} ORDER BY AD_CODE
- </select>
- <select id="getAdDataByAdCode" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select guid,
- ad_code,
- ad_name,
- low_left_long,
- low_left_lat,
- up_right_long,
- up_right_lat,
- up_ad_name,
- ad_grad,
- ad_abbr_name,
- ad_stat,
- ad_area,
- ad_full_name,
- note,
- eff_date,
- expr_date,
- ad_stat_long,
- ad_stat_lat,
- domain_code,
- ad_sign,
- modifier_people,
- upd_date,
- is_report,
- ad_fcode,lgtd,lttd from att_ad_x_base WHERE AD_CODE IN
- <foreach collection="adCodes.split(',')" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- ORDER BY AD_CODE
- </select>
- <select id="findXZCZhenMfdpList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- select e.ad_code,e.ad_name from att_ad_x_base e where e.ad_code like '${adCode}___000%' and substr(e.ad_code,7)!='000000'
- and e.ad_code not in (
- select ad_code from BIS_INSP_MFDP_RGSTR_OBJ l where l.rgstr_id=#{regstrId} and l.INSP_OBJ_TYPE = '3'
- )
- </select>
- <select id="findXZCCunMfdpList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
- from att_ad_x_base e where
- e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
- select ad_code from BIS_INSP_MFDP_RGSTR_OBJ l where l.rgstr_id=#{regstrId} and l.INSP_OBJ_TYPE = '4'
- )
- order by e.ad_code asc
- </select>
- <select id="findXZCCunIrrList" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
- from att_ad_x_base e where
- e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
- select ad_code from BIS_INSP_IRR_TOWNS_DSU l where l.data_stat = '0' and l.rgstr_id=#{rgstrId}
- and l.ad_code is not null
- )
- order by e.ad_code asc
- </select>
- <select id="findXZCCunListByType" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto">
- select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end) is_poveryt
- from att_ad_x_base e where
- e.ad_code like '${adCode}%' and substr(e.ad_code,10)!='000' and e.ad_code not in (
- select ad_code from
- <if test='type == "37"'>
- BIS_RDWSP_RGSTR_REL_VILL
- </if>
- l where l.regstr_id=#{regstrId}
- )
- order by e.ad_code asc
- </select>
- <select id="getAdDataXj" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select guid,
- ad_code,
- ad_name,
- low_left_long,
- low_left_lat,
- up_right_long,
- up_right_lat,
- up_ad_name,
- ad_grad,
- ad_abbr_name,
- ad_stat,
- ad_area,
- ad_full_name,
- note,
- eff_date,
- expr_date,
- ad_stat_long,
- ad_stat_lat,
- domain_code,
- ad_sign,
- modifier_people,
- upd_date,
- is_report,
- ad_fcode,lgtd,lttd from att_ad_x_base
- where ad_name not like '兵团%'
- <if test='adCode == "660000000000"'>
- and FIND_IN_SET(ad_code , getSubNodes_att_ad_x_base(#{adCode}, substr(#{adCode},1,2) ,1) ) > 0
- </if>
- <if test='adCode != "660000000000"'>
- and FIND_IN_SET(ad_code , getSubNodes_att_ad_x_base(#{adCode}, substr(#{adCode},1,2) ,2) ) > 0
- </if>
- </select>
- <select id="getAdChild" resultType="cn.com.goldenwater.dcproj.model.AttAdXBase">
- select * from att_ad_x_base where ad_code like concat(#{adCode},'%')
- </select>
- </mapper>
|