| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <?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.BisInspVlgdrinkFacOperDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper" id="bisInspVlgdrinkFacOperResultMap">
- <result property="adnm" column="ADNM"/>
- <result property="runstseId" column="RUNSTSE_ID"/>
- <result property="engId" column="ENG_ID"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="isNdAdmin" column="IS_ND_ADMIN"/>
- <result property="isAdmin" column="IS_ADMIN"/>
- <result property="adminNm" column="ADMIN_NM"/>
- <result property="adminAge" column="ADMIN_AGE"/>
- <result property="adminPro" column="ADMIN_PRO"/>
- <result property="salary" column="SALARY"/>
- <result property="operFee" column="OPER_FEE"/>
- <result property="otherFeeOrg" column="OTHER_FEE_ORG"/>
- <result property="feeCommons" column="FEE_COMMONS"/>
- <result property="visitDate" column="VISIT_DATE"/>
- <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"/>
- <result property="isComMng" column="IS_COM_MNG"/>
- </resultMap>
- <sql id="table_columns">
- ADNM ,
- RUNSTSE_ID ,
- ENG_ID ,
- AD_CODE ,
- IS_ND_ADMIN ,
- IS_ADMIN ,
- ADMIN_NM ,
- ADMIN_AGE ,
- ADMIN_PRO ,
- SALARY ,
- OPER_FEE ,
- OTHER_FEE_ORG ,
- FEE_COMMONS ,
- DATE_FORMAT(VISIT_DATE,'%Y-%m-%d') VISIT_DATE,
- REC_PERS_ID ,
- REC_PERS2 ,
- REC_PERS_TEL ,
- DATE_FORMAT(CREATE_TIME,'%Y-%m-%d %T') CREATE_TIME,
- DATE_FORMAT(UPDATE_TIME,'%Y-%m-%d %T') UPDATE_TIME,
- STATUS,
- IS_COM_MNG
- </sql>
- <sql id="table_columns2">
- ADNM ,
- RUNSTSE_ID ,
- ENG_ID ,
- AD_CODE ,
- IS_ND_ADMIN ,
- IS_ADMIN ,
- ADMIN_NM ,
- ADMIN_AGE ,
- ADMIN_PRO ,
- SALARY ,
- OPER_FEE ,
- OTHER_FEE_ORG ,
- FEE_COMMONS ,
- VISIT_DATE ,
- REC_PERS_ID ,
- REC_PERS2 ,
- REC_PERS_TEL ,
- CREATE_TIME ,
- UPDATE_TIME ,
- STATUS,
- IS_COM_MNG
- </sql>
- <sql id="entity_properties">
- #{adnm},
- #{runstseId},
- #{engId},
- #{adCode},
- #{isNdAdmin},
- #{isAdmin},
- #{adminNm},
- #{adminAge},
- #{adminPro},
- #{salary},
- #{operFee},
- #{otherFeeOrg},
- #{feeCommons},
- STR_TO_DATE(#{visitDate},'%Y-%m-%d'),
- #{recPersId},
- #{recPers2},
- #{recPersTel},
- STR_TO_DATE(#{createTime},'%Y-%m-%d %T') ,
- STR_TO_DATE(#{updateTime},'%Y-%m-%d %T') ,
- #{status},
- #{isComMng}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="adnm != null and adnm != ''">and ADNM = #{adnm}</if>
- <if test="runstseId != null and runstseId != ''">and RUNSTSE_ID = #{runstseId}</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="isNdAdmin != null and isNdAdmin != ''">and IS_ND_ADMIN = #{isNdAdmin}</if>
- <if test="isAdmin != null and isAdmin != ''">and IS_ADMIN = #{isAdmin}</if>
- <if test="adminNm != null and adminNm != ''">and ADMIN_NM = #{adminNm}</if>
- <if test="adminAge != null and adminAge != ''">and ADMIN_AGE = #{adminAge}</if>
- <if test="adminPro != null and adminPro != ''">and ADMIN_PRO = #{adminPro}</if>
- <if test="salary != null and salary != ''">and SALARY = #{salary}</if>
- <if test="operFee != null and operFee != ''">and OPER_FEE = #{operFee}</if>
- <if test="otherFeeOrg != null and otherFeeOrg != ''">and OTHER_FEE_ORG = #{otherFeeOrg}</if>
- <if test="feeCommons != null and feeCommons != ''">and FEE_COMMONS = #{feeCommons}</if>
- <if test="visitDate != null and visitDate != ''">and VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d')</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 %T')
- </if>
- <if test="updateTime != null and updateTime != ''">and UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %T')
- </if>
- <if test="status != null and status != ''">and STATUS = #{status}</if>
- <if test="isComMng != null and isComMng != ''">and IS_COM_MNG = #{isComMng}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspVlgdrinkFacOperResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_VLGDRINK_FAC_OPER where RUNSTSE_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspVlgdrinkFacOperResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_VLGDRINK_FAC_OPER
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspVlgdrinkFacOperResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_VLGDRINK_FAC_OPER
- </select>
- <select id="findList" resultMap="bisInspVlgdrinkFacOperResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_VLGDRINK_FAC_OPER
- <include refid="page_where"/>
- ORDER BY UPDATE_TIME DESC
- </select>
- <select id="selectCount" resultType="int">
- select count(RUNSTSE_ID) from BIS_INSP_VLGDRINK_FAC_OPER
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper">
- insert into BIS_INSP_VLGDRINK_FAC_OPER(
- <include refid="table_columns2"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_VLGDRINK_FAC_OPER where RUNSTSE_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper">
- delete from BIS_INSP_VLGDRINK_FAC_OPER
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_VLGDRINK_FAC_OPER set flag_valid = 0 where RUNSTSE_ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper">
- update BIS_INSP_VLGDRINK_FAC_OPER
- <trim prefix="set" suffixOverrides=",">
- <if test="adnm != null and adnm != ''">ADNM = #{adnm},</if>
- <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="isNdAdmin != null and isNdAdmin != ''">IS_ND_ADMIN = #{isNdAdmin},</if>
- <if test="isAdmin != null and isAdmin != ''">IS_ADMIN = #{isAdmin},</if>
- <if test="adminNm != null and adminNm != ''">ADMIN_NM = #{adminNm},</if>
- <if test="adminAge != null and adminAge != ''">ADMIN_AGE = #{adminAge},</if>
- <if test="adminPro != null and adminPro != ''">ADMIN_PRO = #{adminPro},</if>
- <if test="salary != null and salary != ''">SALARY = #{salary},</if>
- <if test="operFee != null and operFee != ''">OPER_FEE = #{operFee},</if>
- <if test="otherFeeOrg != null and otherFeeOrg != ''">OTHER_FEE_ORG = #{otherFeeOrg},</if>
- <if test="feeCommons != null and feeCommons != ''">FEE_COMMONS = #{feeCommons},</if>
- <if test="visitDate != null and visitDate != ''">VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d'),</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 %T'),
- </if>
- <if test="updateTime != null and updateTime != ''">UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %T'),
- </if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="isComMng != null and isComMng != ''">IS_COM_MNG = #{isComMng},</if>
- </trim>
- <where>RUNSTSE_ID = #{runstseId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper">
- update BIS_INSP_VLGDRINK_FAC_OPER
- <trim prefix="set" suffixOverrides=",">
- <if test="adnm != null and adnm != ''">ADNM = #{adnm},</if>
- <if test="engId != null and engId != ''">ENG_ID = #{engId},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="isNdAdmin != null and isNdAdmin != ''">IS_ND_ADMIN = #{isNdAdmin},</if>
- <if test="isAdmin != null and isAdmin != ''">IS_ADMIN = #{isAdmin},</if>
- <if test="adminNm != null and adminNm != ''">ADMIN_NM = #{adminNm},</if>
- <if test="adminAge != null and adminAge != ''">ADMIN_AGE = #{adminAge},</if>
- <if test="adminPro != null and adminPro != ''">ADMIN_PRO = #{adminPro},</if>
- <if test="salary != null and salary != ''">SALARY = #{salary},</if>
- <if test="operFee != null and operFee != ''">OPER_FEE = #{operFee},</if>
- <if test="otherFeeOrg != null and otherFeeOrg != ''">OTHER_FEE_ORG = #{otherFeeOrg},</if>
- <if test="feeCommons != null and feeCommons != ''">FEE_COMMONS = #{feeCommons},</if>
- <if test="visitDate != null and visitDate != ''">VISIT_DATE = STR_TO_DATE(#{visitDate},'%Y-%m-%d'),</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 %T'),
- </if>
- <if test="updateTime != null and updateTime != ''">UPDATE_TIME = STR_TO_DATE(#{updateTime},'%Y-%m-%d %T'),
- </if>
- <if test="status != null and status != ''">STATUS = #{status},</if>
- <if test="isComMng != null and isComMng != ''">IS_COM_MNG = #{isComMng},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getListByCodeAndPerId" parameterType="cn.com.goldenwater.dcproj.dto.VillRgstrDto"
- resultType="cn.com.goldenwater.dcproj.model.BisInspVlgdrinkFacOper">
- SELECT *
- FROM BIS_INSP_VLGDRINK_FAC_OPER 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.BisInspVlgdrinkFacOperDcdxDto">
- select A.ADNM ,
- A.RUNSTSE_ID ,
- A.ENG_ID ,
- A.AD_CODE ,
- A.IS_ND_ADMIN ,
- A.IS_ADMIN ,
- A.ADMIN_NM ,
- A.ADMIN_AGE ,
- A.ADMIN_PRO ,
- A.SALARY ,
- A.OPER_FEE ,
- A.OTHER_FEE_ORG ,
- A.FEE_COMMONS ,
- DATE_FORMAT(A.VISIT_DATE,'%Y-%m-%d') VISIT_DATE,
- A.REC_PERS_ID ,
- A.REC_PERS2 ,
- A.REC_PERS_TEL ,
- DATE_FORMAT(A.CREATE_TIME,'%Y-%m-%d %T') CREATE_TIME,
- DATE_FORMAT(A.UPDATE_TIME,'%Y-%m-%d %T') UPDATE_TIME,
- A.STATUS,
- A.IS_COM_MNG,D.PNM GROUP_NM,F.PNM CHKCOM,H.AD_NAME TOWN,I.AD_NAME COUNTY,J.AD_NAME CITY,K.AD_NAME PROVINCE
- from
- BIS_INSP_VLGDRINK_FAC_OPER 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 G ON A.AD_CODE=G.AD_CODE
- LEFT JOIN ATT_AD_X_BASE H ON G.AD_FCODE=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
- LEFT JOIN ATT_AD_X_BASE K ON J.AD_FCODE=K.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 <STR_TO_DATE(#{endDate},'%Y-%m-%d')
- </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(
- A.ADNM LIKE CONCAT('%', #{adNm}, '%' )
- OR H.AD_NAME LIKE CONCAT('%', #{adNm}, '%')
- OR I.AD_NAME LIKE CONCAT('%', #{adNm}, '%')
- OR J.AD_NAME LIKE CONCAT('%', #{adNm}, '%')
- OR K.AD_NAME LIKE CONCAT('%', #{adNm}, '%')
- )
- </if>
- ORDER BY A.UPDATE_TIME DESC,A.VISIT_DATE DESC
- </select>
- </mapper>
|