| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <?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.AttEmpwtprjBaseDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase" id="attEmpwtprjBaseResultMap">
- <result property="adName" column="AD_NAME"/>
- <result property="buidTimeYear" column="BUID_TIME_YEAR"/>
- <result property="engSta" column="ENG_STA"/>
- <result property="id" column="ID"/>
- <result property="ptype" column="PTYPE"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="nm" column="NM"/>
- <result property="stwktm" column="STWKTM"/>
- <result property="plantm" column="PLANTM"/>
- <result property="estapp" column="ESTAPP"/>
- <result property="sumApp" column="SUM_APP"/>
- <result property="planApp" column="PLAN_APP"/>
- <result property="lgtd" column="LGTD"/>
- <result property="lttd" column="LTTD"/>
- <result property="lgtdPc" column="LGTD_PC"/>
- <result property="lttdPc" column="LTTD_PC"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="note" column="NOTE"/>
- <result property="unitId" column="UNIT_ID"/>
- <result property="unitNm" column="UNIT_NM"/>
- <result property="engProfil" column="ENG_PROFIL"/>
- <result property="engBuild" column="ENG_BUILD"/>
- <result property="hstInsp" column="HST_INSP"/>
- <result property="fenjiUnit" column="FENJI_UNIT"/>
- </resultMap>
- <sql id="table_columns">
- AD_NAME,ENG_PROFIL,ENG_BUILD,HST_INSP,FENJI_UNIT,SUM_APP,PLAN_APP,
- BUID_TIME_YEAR,
- ENG_STA,
- ID,
- PTYPE,
- AD_CODE,
- NM,
- STWKTM,
- PLANTM,
- ESTAPP,
- LGTD,
- LTTD,
- LGTD_PC,
- LTTD_PC,
- INTM,
- UPTM,
- NOTE,
- UNIT_ID,
- UNIT_NM
- </sql>
- <sql id="entity_properties">
- #{adName}, #{engProfil}, #{engBuild}, #{hstInsp},#{fenjiUnit},#{sumApp},#{planApp},
- #{buidTimeYear},
- #{engSta},
- #{id},
- #{ptype},
- #{adCode},
- #{nm},
- #{stwktm},
- #{plantm},
- #{estapp},
- #{lgtd},
- #{lttd},
- #{lgtdPc},
- #{lttdPc},
- #{intm},
- #{uptm},
- #{note},
- #{unitId},
- #{unitNm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="buidTimeYear != null and buidTimeYear != ''">and BUID_TIME_YEAR = #{buidTimeYear}</if>
- <if test="engSta != null">and ENG_STA = #{engSta}</if>
- <if test="planApp != null">and PLAN_APP = #{planApp}</if>
- <if test="sumApp != null">and SUM_APP = #{sumApp}</if>
- <if test="fenjiUnit != null and fenjiUnit !=''">and fenji_Unit = #{fenjiUnit}</if>
- <if test="id != null and id != ''">and ID = #{id}</if>
- <if test="ptype != null and ptype != ''">and PTYPE = #{ptype}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="nm != null and nm != ''">and NM = #{nm}</if>
- <if test="stwktm != null and stwktm != ''">and STWKTM = #{stwktm}</if>
- <if test="plantm != null and plantm != ''">and PLANTM = #{plantm}</if>
- <if test="estapp != null and estapp != ''">and ESTAPP = #{estapp}</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 LGTD_PC = #{lgtdPc}</if>
- <if test="lttdPc != null and lttdPc != ''">and LTTD_PC = #{lttdPc}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="unitId != null and unitId != ''">and UNIT_ID = #{unitId}</if>
- <if test="unitNm != null and unitNm != ''">and UNIT_NM = #{unitNm}</if>
- <if test="engProfil != null and engProfil != ''">and eng_Profil = #{engProfil}</if>
- <if test="engBuild != null and engBuild != ''">and eng_Build = #{engBuild}</if>
- <if test="hstInsp != null and hstInsp != ''">and hst_Insp = #{hstInsp}</if>
- </trim>
- </sql>
- <select id="get" resultMap="attEmpwtprjBaseResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from ATT_EMPWTPRJ_BASE where ID = #{id}
- </select>
- <select id="getBy" resultMap="attEmpwtprjBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_EMPWTPRJ_BASE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="attEmpwtprjBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_EMPWTPRJ_BASE
- </select>
- <select id="findList" resultMap="attEmpwtprjBaseResultMap">
- select
- <include refid="table_columns"/>
- from ATT_EMPWTPRJ_BASE
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from ATT_EMPWTPRJ_BASE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
- insert into ATT_EMPWTPRJ_BASE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_EMPWTPRJ_BASE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
- delete from ATT_EMPWTPRJ_BASE
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_EMPWTPRJ_BASE set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
- update ATT_EMPWTPRJ_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="buidTimeYear != null and buidTimeYear != ''">BUID_TIME_YEAR = #{buidTimeYear},</if>
- <if test="engSta != null">ENG_STA = #{engSta},</if>
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="nm != null and nm != ''">NM = #{nm},</if>
- <if test="stwktm != null and stwktm != ''">STWKTM = #{stwktm},</if>
- <if test="plantm != null and plantm != ''">PLANTM = #{plantm},</if>
- <if test="estapp != null and estapp != ''">ESTAPP = #{estapp},</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 != ''">LGTD_PC = #{lgtdPc},</if>
- <if test="lttdPc != null and lttdPc != ''">LTTD_PC = #{lttdPc},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
- <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
- <if test="engProfil != null and engProfil != ''"> eng_Profil = #{engProfil},</if>
- <if test="engBuild != null and engBuild != ''"> eng_Build = #{engBuild},</if>
- <if test="hstInsp != null and hstInsp != ''"> hst_Insp = #{hstInsp},</if>
- <if test="fenjiUnit != null and fenjiUnit !=''"> FENJI_UNIT = #{fenjiUnit},</if>
- <if test="planApp != null"> PLAN_APP = #{planApp},</if>
- <if test="sumApp != null"> SUM_APP = #{sumApp},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
- update ATT_EMPWTPRJ_BASE
- <trim prefix="set" suffixOverrides=",">
- <if test="buidTimeYear != null and buidTimeYear != ''">BUID_TIME_YEAR = #{buidTimeYear},</if>
- <if test="engSta != null">ENG_STA = #{engSta},</if>
- <if test="id != null and id != ''">ID = #{id},</if>
- <if test="ptype != null and ptype != ''">PTYPE = #{ptype},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="nm != null and nm != ''">NM = #{nm},</if>
- <if test="stwktm != null and stwktm != ''">STWKTM = #{stwktm},</if>
- <if test="plantm != null and plantm != ''">PLANTM = #{plantm},</if>
- <if test="estapp != null and estapp != ''">ESTAPP = #{estapp},</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 != ''">LGTD_PC = #{lgtdPc},</if>
- <if test="lttdPc != null and lttdPc != ''">LTTD_PC = #{lttdPc},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="unitId != null and unitId != ''">UNIT_ID = #{unitId},</if>
- <if test="unitNm != null and unitNm != ''">UNIT_NM = #{unitNm},</if>
- <if test="engProfil != null and engProfil != ''"> eng_Profil = #{engProfil},</if>
- <if test="engBuild != null and engBuild != ''"> eng_Build = #{engBuild},</if>
- <if test="hstInsp != null and hstInsp != ''"> hst_Insp = #{hstInsp},</if>
- <if test="fenjiUnit != null and fenjiUnit !=''"> FENJI_UNIT = #{fenjiUnit},</if>
- <if test="planApp != null"> PLAN_APP = #{planApp},</if>
- <if test="sumApp != null"> SUM_APP = #{sumApp},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <sql id="orgIdSql">
- <choose>
- <when test="orgId !=null and orgId !=''">
- and ORG_ID=#{orgId}
- </when>
- <otherwise>
- and ORG_ID is null
- </otherwise>
- </choose>
- </sql>
- <!-- 其他自定义SQL -->
- <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam" resultType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase">
- SELECT A.ID,A.eng_Profil,A.eng_Build,A.hst_Insp,A.FENJI_UNIT,A.PLAN_APP,A.SUM_APP,
- A.PTYPE,
- A.AD_CODE,
- A.NM,
- A.STWKTM,
- A.PLANTM,
- A.ESTAPP,
- A.LGTD,
- A.LTTD,
- A.LGTD_PC,
- A.LTTD_PC,
- A.INTM,
- A.UPTM,
- A.NOTE,
- A.UNIT_ID,
- A.UNIT_NM,
- A.AD_NAME,
- A.ENG_STA,B.OBJ_ID,
- A.BUID_TIME_YEAR FROM ATT_EMPWTPRJ_BASE A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.ID = B.CODE
- WHERE B.PTYPE = #{objType}
- <choose>
- <when test="province !=null and province !=''">
- and B.AD_CODE=#{province}
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- AND
- B.id in (${inIdsSql})
- <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
- <if test="stnm != null and stnm != ''">and A.NM LIKE '%${stnm}%'</if>
- <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.LGTD_PC BETWEEN #{minLgtd} AND #{maxLgtd}</if>
- <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.LTTD_PC BETWEEN #{minLttd} AND #{maxLttd}</if>
- </select>
- <select id="getObjListNotInspGroupId" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttEmpwtprjBase" >
- select t.*
- from ATT_EMPWTPRJ_BASE t
- where t.id 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>
- </mapper>
|