| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <?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.BisInspManageResponsibilityDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility"
- id="bisInspManageResponsibilityResultMap">
- <result property="accompany" column="ACCOMPANY"/>
- <result property="mngrId" column="MNGR_ID"/>
- <result property="engId" column="ENG_ID"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="personAmount" column="PERSON_AMOUNT"/>
- <result property="focusSupplyPerc" column="FOCUS_SUPPLY_PERC"/>
- <result property="waterSupplyPerc" column="WATER_SUPPLY_PERC"/>
- <result property="isGovRes" column="IS_GOV_RES"/>
- <result property="isConRes" column="IS_CON_RES"/>
- <result property="isDeptRes" column="IS_DEPT_RES"/>
- <result property="isCntyDept" column="IS_CNTY_DEPT"/>
- <result property="isCntyFunc" column="IS_CNTY_FUNC"/>
- <result property="isCntyFee" column="IS_CNTY_FEE"/>
- <result property="isQuailtyChk" column="IS_QUAILTY_CHK"/>
- <result property="pracFee" column="PRAC_FEE"/>
- <result property="visitDate" column="VISIT_DATE"/>
- <result property="visitorId" column="VISITOR_ID"/>
- <result property="recPersId" column="REC_PERS_ID"/>
- <result property="recPers2" column="REC_PERS2"/>
- <result property="recPersTel" column="REC_PERS_TEL"/>
- <result property="createTime" column="CREATE_TIME"/>
- <result property="updateTime" column="UPDATE_TIME"/>
- <result property="status" column="STATUS"/>
- </resultMap>
- <sql id="table_columns">
- ACCOMPANY ,
- MNGR_ID ,
- ENG_ID ,
- AD_CODE ,
- PERSON_AMOUNT ,
- FOCUS_SUPPLY_PERC ,
- WATER_SUPPLY_PERC ,
- IS_GOV_RES ,
- IS_CON_RES ,
- IS_DEPT_RES ,
- IS_CNTY_DEPT ,
- IS_CNTY_FUNC ,
- IS_CNTY_FEE ,
- IS_QUAILTY_CHK ,
- PRAC_FEE ,
- DATE_FORMAT(VISIT_DATE,'%Y-%m-%d') VISIT_DATE,
- VISITOR_ID ,
- REC_PERS_ID ,
- REC_PERS2 ,
- REC_PERS_TEL ,
- DATE_FORMAT(CREATE_TIME,'%Y-%m-%d %H:%i:%s') CREATE_TIME,
- DATE_FORMAT(UPDATE_TIME,'%Y-%m-%d %H:%i:%s') UPDATE_TIME,
- STATUS
- </sql>
- <sql id="table_columns2">
- ACCOMPANY ,
- MNGR_ID ,
- ENG_ID ,
- AD_CODE ,
- PERSON_AMOUNT ,
- FOCUS_SUPPLY_PERC ,
- WATER_SUPPLY_PERC ,
- IS_GOV_RES ,
- IS_CON_RES ,
- IS_DEPT_RES ,
- IS_CNTY_DEPT ,
- IS_CNTY_FUNC ,
- IS_CNTY_FEE ,
- IS_QUAILTY_CHK ,
- PRAC_FEE ,
- VISIT_DATE ,
- VISITOR_ID ,
- REC_PERS_ID ,
- REC_PERS2 ,
- REC_PERS_TEL ,
- CREATE_TIME ,
- UPDATE_TIME ,
- STATUS
- </sql>
- <sql id="entity_properties">
- #{accompany},
- #{mngrId},
- #{engId},
- #{adCode},
- #{personAmount},
- #{focusSupplyPerc},
- #{waterSupplyPerc},
- #{isGovRes},
- #{isConRes},
- #{isDeptRes},
- #{isCntyDept},
- #{isCntyFunc},
- #{isCntyFee},
- #{isQuailtyChk},
- #{pracFee},
- STR_TO_DATE(#{visitDate},'%Y-%m-%d'),
- #{visitorId},
- #{recPersId},
- #{recPers2},
- #{recPersTel},
- STR_TO_DATE(#{createTime},'%Y-%m-%d %H:%i:%s') ,
- STR_TO_DATE(#{updateTime},'%Y-%m-%d %H:%i:%s') ,
- #{status}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="accompany != null and accompany != ''">and ACCOMPANY = #{accompany}</if>
- <if test="mngrId != null and mngrId != ''">and MNGR_ID = #{mngrId}</if>
- <if test="engId != null and engId != ''">and ENG_ID = #{engId}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="personAmount != null and personAmount != ''">and PERSON_AMOUNT = #{personAmount}</if>
- <if test="focusSupplyPerc != null and focusSupplyPerc != ''">and FOCUS_SUPPLY_PERC = #{focusSupplyPerc}</if>
- <if test="waterSupplyPerc != null and waterSupplyPerc != ''">and WATER_SUPPLY_PERC = #{waterSupplyPerc}</if>
- <if test="isGovRes != null and isGovRes != ''">and IS_GOV_RES = #{isGovRes}</if>
- <if test="isConRes != null and isConRes != ''">and IS_CON_RES = #{isConRes}</if>
- <if test="isDeptRes != null and isDeptRes != ''">and IS_DEPT_RES = #{isDeptRes}</if>
- <if test="isCntyDept != null and isCntyDept != ''">and IS_CNTY_DEPT = #{isCntyDept}</if>
- <if test="isCntyFunc != null and isCntyFunc != ''">and IS_CNTY_FUNC = #{isCntyFunc}</if>
- <if test="isCntyFee != null and isCntyFee != ''">and IS_CNTY_FEE = #{isCntyFee}</if>
- <if test="isQuailtyChk != null and isQuailtyChk != ''">and IS_QUAILTY_CHK = #{isQuailtyChk}</if>
- <if test="pracFee != null and pracFee != ''">and PRAC_FEE = #{pracFee}</if>
- <if test="visitDate != null and visitDate != ''">and VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d')</if>
- <if test="visitorId != null and visitorId != ''">and VISITOR_ID = #{visitorId}</if>
- <if test="recPersId != null and recPersId != ''">and REC_PERS_ID = #{recPersId}</if>
- <if test="recPers2 != null and recPers2 != ''">and REC_PERS2 = #{recPers2}</if>
- <if test="recPersTel != null and recPersTel != ''">and REC_PERS_TEL = #{recPersTel}</if>
- <if test="createTime != null and createTime != ''">and CREATE_TIME = STR_TO_DATE(#{createTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %H:%i:%s')
- </if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspManageResponsibilityResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MANAGE_RESPONSIBILITY where MNGR_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspManageResponsibilityResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MANAGE_RESPONSIBILITY
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspManageResponsibilityResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MANAGE_RESPONSIBILITY
- </select>
- <select id="findList" resultMap="bisInspManageResponsibilityResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MANAGE_RESPONSIBILITY
- <include refid="page_where"/>
- ORDER BY UPDATE_TIME DESC
- </select>
- <select id="selectCount" resultType="int">
- select count(MNGR_ID) from BIS_INSP_MANAGE_RESPONSIBILITY
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility">
- insert into BIS_INSP_MANAGE_RESPONSIBILITY(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_MANAGE_RESPONSIBILITY where MNGR_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility">
- delete from BIS_INSP_MANAGE_RESPONSIBILITY
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_MANAGE_RESPONSIBILITY set flag_valid = 0 where MNGR_ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility">
- update BIS_INSP_MANAGE_RESPONSIBILITY
- <trim prefix="set" suffixOverrides=",">
- <if test="accompany != null and accompany != ''">ACCOMPANY = #{accompany},</if>
- <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="personAmount != null and personAmount != ''">PERSON_AMOUNT = #{personAmount},</if>
- <if test="focusSupplyPerc != null and focusSupplyPerc != ''">FOCUS_SUPPLY_PERC = #{focusSupplyPerc},</if>
- <if test="waterSupplyPerc != null and waterSupplyPerc != ''">WATER_SUPPLY_PERC = #{waterSupplyPerc},</if>
- <if test="isGovRes != null and isGovRes != ''">IS_GOV_RES = #{isGovRes},</if>
- <if test="isConRes != null and isConRes != ''">IS_CON_RES = #{isConRes},</if>
- <if test="isDeptRes != null and isDeptRes != ''">IS_DEPT_RES = #{isDeptRes},</if>
- <if test="isCntyDept != null and isCntyDept != ''">IS_CNTY_DEPT = #{isCntyDept},</if>
- <if test="isCntyFunc != null and isCntyFunc != ''">IS_CNTY_FUNC = #{isCntyFunc},</if>
- <if test="isCntyFee != null and isCntyFee != ''">IS_CNTY_FEE = #{isCntyFee},</if>
- <if test="isQuailtyChk != null and isQuailtyChk != ''">IS_QUAILTY_CHK = #{isQuailtyChk},</if>
- <if test="pracFee != null and pracFee != ''">PRAC_FEE = #{pracFee},</if>
- <if test="visitDate != null and visitDate != ''">VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d'),</if>
- <if test="visitorId != null and visitorId != ''">VISITOR_ID = #{visitorId},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
- <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
- <if test="createTime != null and createTime != ''">CREATE_TIME = STR_TO_DATE(#{createTime},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="updateTime != null and updateTime != ''">UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- </trim>
- <where>MNGR_ID = #{mngrId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility">
- update BIS_INSP_MANAGE_RESPONSIBILITY
- <trim prefix="set" suffixOverrides=",">
- <if test="accompany != null and accompany != ''">ACCOMPANY = #{accompany},</if>
- <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="personAmount != null and personAmount != ''">PERSON_AMOUNT = #{personAmount},</if>
- <if test="focusSupplyPerc != null and focusSupplyPerc != ''">FOCUS_SUPPLY_PERC = #{focusSupplyPerc},</if>
- <if test="waterSupplyPerc != null and waterSupplyPerc != ''">WATER_SUPPLY_PERC = #{waterSupplyPerc},</if>
- <if test="isGovRes != null and isGovRes != ''">IS_GOV_RES = #{isGovRes},</if>
- <if test="isConRes != null and isConRes != ''">IS_CON_RES = #{isConRes},</if>
- <if test="isDeptRes != null and isDeptRes != ''">IS_DEPT_RES = #{isDeptRes},</if>
- <if test="isCntyDept != null and isCntyDept != ''">IS_CNTY_DEPT = #{isCntyDept},</if>
- <if test="isCntyFunc != null and isCntyFunc != ''">IS_CNTY_FUNC = #{isCntyFunc},</if>
- <if test="isCntyFee != null and isCntyFee != ''">IS_CNTY_FEE = #{isCntyFee},</if>
- <if test="isQuailtyChk != null and isQuailtyChk != ''">IS_QUAILTY_CHK = #{isQuailtyChk},</if>
- <if test="pracFee != null and pracFee != ''">PRAC_FEE = #{pracFee},</if>
- <if test="visitDate != null and visitDate != ''">VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d'),</if>
- <if test="visitorId != null and visitorId != ''">VISITOR_ID = #{visitorId},</if>
- <if test="recPersId != null and recPersId != ''">REC_PERS_ID = #{recPersId},</if>
- <if test="recPers2 != null and recPers2 != ''">REC_PERS2 = #{recPers2},</if>
- <if test="recPersTel != null and recPersTel != ''">REC_PERS_TEL = #{recPersTel},</if>
- <if test="createTime != null and createTime != ''">CREATE_TIME = STR_TO_DATE(#{createTime},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="updateTime != null and updateTime != ''">UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %H:%i:%s'),
- </if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getMsCounts" resultType="int">
- SELECT
- COUNT(B.ENG_ID)
- FROM
- BIS_INSP_VILL_RGSTR A
- LEFT JOIN BIS_INSP_MANAGE_RESPONSIBILITY B ON A.ENG_ID = B.ENG_ID
- WHERE
- A.OBJ_ID = #{objId}
- </select>
- <sql id="orgIdSql">
- <choose>
- <when test="orgId !=null and orgId !=''">
- and ORG_ID=#{orgId}
- </when>
- <otherwise>
- and ORG_ID is null
- </otherwise>
- </choose>
- </sql>
- <select id="getListByCodeAndPerId" parameterType="cn.com.goldenwater.dcproj.dto.VillRgstrDto"
- resultType="cn.com.goldenwater.dcproj.model.BisInspManageResponsibility">
- SELECT * FROM BIS_INSP_MANAGE_RESPONSIBILITY A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
- LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
- WHERE
- C.id in (${inIdsSql})
- AND C.CODE LIKE '${adCode}%' AND C.PTYPE = '2'
- </select>
- <select id="getPageByNodeId" parameterType="cn.com.goldenwater.dcproj.param.GetVillPageByNodeIdParam"
- resultType="cn.com.goldenwater.dcproj.dto.BisInspManageResponsibilityDcdxDto">
- select A.ACCOMPANY ,
- A.MNGR_ID ,
- A.ENG_ID ,
- A.AD_CODE ,
- A.PERSON_AMOUNT ,
- A.FOCUS_SUPPLY_PERC ,
- A.WATER_SUPPLY_PERC ,
- A.IS_GOV_RES ,
- A.IS_CON_RES ,
- A.IS_DEPT_RES ,
- A.IS_CNTY_DEPT ,
- A.IS_CNTY_FUNC ,
- A.IS_CNTY_FEE ,
- A.IS_QUAILTY_CHK ,
- A.PRAC_FEE ,
- DATE_FORMAT(A.VISIT_DATE,'%Y-%m-%d') VISIT_DATE,
- A.VISITOR_ID ,
- A.REC_PERS_ID ,
- A.REC_PERS2 ,
- A.REC_PERS_TEL ,
- DATE_FORMAT(A.CREATE_TIME,'%Y-%m-%d %H:%i:%s') CREATE_TIME,
- DATE_FORMAT(A.UPDATE_TIME,'%Y-%m-%d %H:%i:%s') UPDATE_TIME,
- A.STATUS ,D.PNM GROUP_NM,F.PNM CHKCOM,F.ID CHKID,H.AD_NAME COUNTY,I.AD_NAME CITY,J.AD_NAME PROVINCE from
- BIS_INSP_MANAGE_RESPONSIBILITY A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID=B.ENG_ID LEFT JOIN bis_insp_all_obj
- C ON B.OBJ_ID=C.OBJ_ID
- LEFT JOIN BIS_INSP_ALL D ON C.ID=D.ID LEFT JOIN BIS_INSP_ALL E ON D.PID=E.ID LEFT JOIN BIS_INSP_ALL F ON
- E.PID=F.ID
- LEFT JOIN ATT_AD_X_BASE H ON A.AD_CODE=H.AD_CODE
- LEFT JOIN ATT_AD_X_BASE I ON H.AD_FCODE=I.AD_CODE LEFT JOIN ATT_AD_X_BASE J ON I.AD_FCODE=J.AD_CODE WHERE 1=1
- <if test="nodeId != null and nodeId != ''">
- and C.ID like concat(#{nodeId},'%')
- </if>
- <if test="startDate != null and startDate != ''">
- AND A.VISIT_DATE >=STR_TO_DATE(#{startDate},'%Y-%m-%d')
- </if>
- <if test="endDate != null and endDate != ''">
- AND A.VISIT_DATE <= DATE_ADD(STR_TO_DATE(#{endDate},'%Y-%m-%d'), INTERVAL 1 DAY )
- </if>
- <if test="chkComId != null and chkComId != ''">
- AND F.ID =#{chkComId}
- </if>
- <if test="groupId != null and groupId != ''">
- AND D.ID =#{groupId}
- </if>
- <if test="adNm != null and adNm != ''">
- AND( H.AD_NAME LIKE concat('%',#{adNm},'%') OR I.AD_NAME LIKE concat('%',#{adNm},'%') OR J.AD_NAME LIKE
- concat('%',#{adNm},'%') )
- </if>
- ORDER BY A.UPDATE_TIME DESC,A.VISIT_DATE DESC
- </select>
- </mapper>
|