| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <?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.BisInspPlanDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlan" id="bisInspPlanResultMap">
- <result property="plnaId" column="PLNA_ID"/>
- <result property="guid" column="GUID"/>
- <result property="prsnTitle" column="PRSN_TITLE"/>
- <result property="palnExp" column="PALN_EXP"/>
- <result property="prsnId" column="PRSN_ID"/>
- <result property="palnSttm" column="PALN_STTM"/>
- <result property="palnEntm" column="PALN_ENTM"/>
- <result property="palnState" column="PALN_STATE"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="note" column="NOTE"/>
- </resultMap>
- <resultMap type="cn.com.goldenwater.dcproj.dto.BisInspGroupDto" id="bisInspGroupDtoResultMap">
- <result property="inspGroupId" column="INSP_GROUP_ID"/>
- <result property="plnaId" column="PLNA_ID"/>
- <result property="guid" column="GUID"/>
- <result property="inspGroupName" column="INSP_GROUP_NAME"/>
- <result property="downStat" column="DOWN_STAT"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="collTime" column="COLL_TIME"/>
- <result property="recPers" column="REC_PERS"/>
- <association property="bisInspPlan" javaType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- <result property="plnaId" column="PLNA_ID"/>
- <result property="guid" column="PLAN_GUID"/>
- <result property="prsnTitle" column="PRSN_TITLE"/>
- <result property="palnExp" column="PALN_EXP"/>
- <result property="prsnId" column="PRSN_ID"/>
- <result property="palnSttm" column="PALN_STTM"/>
- <result property="palnEntm" column="PALN_ENTM"/>
- <result property="palnState" column="PALN_STATE"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="note" column="NOTE"/>
- </association>
- </resultMap>
- <sql id="table_columns">
- PLNA_ID,
- GUID,
- PRSN_TITLE,
- PALN_EXP,
- PRSN_ID,
- PALN_STTM,
- PALN_ENTM,
- PALN_STATE,
- INTM,
- UPTM,
- NOTE
- </sql>
- <sql id="entity_properties">
- #{plnaId},
- #{guid},
- #{prsnTitle},
- #{palnExp},
- #{prsnId},
- #{palnSttm},
- #{palnEntm},
- #{palnState},
- #{intm},
- #{uptm},
- #{note}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="prsnTitle != null and prsnTitle != ''">and PRSN_TITLE = #{prsnTitle}</if>
- <if test="palnExp != null and palnExp != ''">and PALN_EXP = #{palnExp}</if>
- <if test="prsnId != null and prsnId != ''">and PRSN_ID = #{prsnId}</if>
- <if test="palnSttm != null">and PALN_STTM = #{palnSttm}</if>
- <if test="palnEntm != null">and PALN_ENTM = #{palnEntm}</if>
- <if test="palnState != null and palnState != ''">and PALN_STATE = #{palnState}</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>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspPlanResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN where GUID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspPlanResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspPlanResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN
- </select>
- <select id="findList" resultMap="bisInspPlanResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_PLAN
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- insert into BIS_INSP_PLAN(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_PLAN where PLNA_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- delete from BIS_INSP_PLAN
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_PLAN set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- update BIS_INSP_PLAN
- <trim prefix="set" suffixOverrides=",">
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="prsnTitle != null and prsnTitle != ''">PRSN_TITLE = #{prsnTitle},</if>
- <if test="palnExp != null and palnExp != ''">PALN_EXP = #{palnExp},</if>
- <if test="prsnId != null and prsnId != ''">PRSN_ID = #{prsnId},</if>
- <if test="palnSttm != null">PALN_STTM = #{palnSttm},</if>
- <if test="palnEntm != null">PALN_ENTM = #{palnEntm},</if>
- <if test="palnState != null and palnState != ''">PALN_STATE = #{palnState},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- update BIS_INSP_PLAN
- <trim prefix="set" suffixOverrides=",">
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="prsnTitle != null and prsnTitle != ''">PRSN_TITLE = #{prsnTitle},</if>
- <if test="palnExp != null and palnExp != ''">PALN_EXP = #{palnExp},</if>
- <if test="prsnId != null and prsnId != ''">PRSN_ID = #{prsnId},</if>
- <if test="palnSttm != null">PALN_STTM = #{palnSttm},</if>
- <if test="palnEntm != null">PALN_ENTM = #{palnEntm},</if>
- <if test="palnState != null and palnState != ''">PALN_STATE = #{palnState},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!--根据人员id查批次-->
- <select id="findListByUserId" resultType="cn.com.goldenwater.dcproj.model.BisInspPlan">
- select t.*
- from BIS_INSP_PLAN t
- left join BIS_INSP_GROUP g
- on t.plna_id = g.plna_id
- left join REL_PERS_INSPGROUP rel
- on rel.insp_group_id = g.insp_group_id
- left join ATT_PERS_BASE p
- on p.guid = rel.pers_id
- left join GW_SYS_USER u
- on u.ofc_id = p.guid
- where u.id = #{userId}
- </select>
- <!--根据人员id查批次-->
- <select id="findListByPersId" resultMap="bisInspGroupDtoResultMap">
- select g.*,t.PLNA_ID,t.GUID PLAN_GUID,t.PRSN_TITLE,t.PALN_EXP,
- t.PRSN_ID,t.PALN_STTM,t.PALN_ENTM,t.PALN_STATE,t.INTM,t.UPTM
- from BIS_INSP_PLAN t
- left join BIS_INSP_GROUP g
- on t.plna_id = g.plna_id
- left join REL_PERS_INSPGROUP rel
- on rel.insp_group_id = g.insp_group_id
- where rel.pers_id = #{persId}
- </select>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and ad_code=#{province}
- </when>
- <otherwise>
- and ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="getAllRlation" resultType="cn.com.goldenwater.dcproj.model.BisInspAllRlation">
- SELECT * FROM BIS_INSP_ALL_RLATION WHERE ID LIKE '${id}%'
- <include refid="choseSql"/>
- </select>
- <select id="getAllObj" resultType="cn.com.goldenwater.dcproj.model.BisInspAllObj">
- SELECT * FROM BIS_INSP_ALL_OBJ WHERE ID LIKE '${id}%'
- <include refid="choseSql"/>
- </select>
- <select id="getAllArea" resultType="cn.com.goldenwater.dcproj.model.BisInspSelArea">
- SELECT * FROM BIS_INSP_SEL_AREA WHERE ID LIKE '${id}%'
- <if test="province !=null and province !=''">
- AND ORG_ID=#{orgId}
- </if>
- </select>
- </mapper>
|