| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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.BisInspGroupDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspGroup" id="bisInspGroupResultMap">
- <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"/>
- <result property="note" column="NOTE"/>
- </resultMap>
- <sql id="table_columns">
- INSP_GROUP_ID,
- PLNA_ID,
- GUID,
- INSP_GROUP_NAME,
- DOWN_STAT,
- DATA_STAT,
- COLL_TIME,
- REC_PERS,
- NOTE
- </sql>
- <sql id="entity_properties">
- #{inspGroupId},
- #{plnaId},
- #{guid},
- #{inspGroupName},
- #{downStat},
- #{dataStat},
- #{collTime},
- #{recPers},
- #{note}
- </sql>
- <sql id="entity_properties_insert">
- #{inspGroupId},
- #{plnaId},
- #{guid},
- #{inspGroupName},
- #{downStat},
- #{dataStat},
- to_date(#{collTime},'yyyy-mm-dd'),
- #{recPers},
- #{note}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="plnaId != null and plnaId != ''">and PLNA_ID = #{plnaId}</if>
- <if test="guid != null and guid != ''">and GUID = #{guid}</if>
- <if test="inspGroupName != null and inspGroupName != ''">and INSP_GROUP_NAME = #{inspGroupName}</if>
- <if test="downStat != null">and DOWN_STAT = #{downStat}</if>
- <if test="dataStat != null">and DATA_STAT = #{dataStat}</if>
- <if test="collTime != null">and COLL_TIME = #{collTime}</if>
- <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspGroupResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_GROUP where GUID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspGroupResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_GROUP
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspGroupResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_GROUP
- </select>
- <select id="findList" resultMap="bisInspGroupResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_GROUP
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_GROUP
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspGroup">
- insert into BIS_INSP_GROUP(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_GROUP where INSP_GROUP_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGroup">
- delete from BIS_INSP_GROUP
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_GROUP set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspGroup">
- update BIS_INSP_GROUP
- <trim prefix="set" suffixOverrides=",">
- <if test="plnaId != null and plnaId != ''">PLNA_ID = #{plnaId},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="inspGroupName != null and inspGroupName != ''">INSP_GROUP_NAME = #{inspGroupName},</if>
- <if test="downStat != null">DOWN_STAT = #{downStat},</if>
- <if test="dataStat != null">DATA_STAT = #{dataStat},</if>
- <if test="collTime != null">COLL_TIME = #{collTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <where>INSP_GROUP_ID = #{inspGroupId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspGroup">
- update BIS_INSP_GROUP
- <trim prefix="set" suffixOverrides=",">
- <if test="plnaId != null and plnaId != ''">PLNA_ID = #{plnaId},</if>
- <if test="guid != null and guid != ''">GUID = #{guid},</if>
- <if test="inspGroupName != null and inspGroupName != ''">INSP_GROUP_NAME = #{inspGroupName},</if>
- <if test="downStat != null">DOWN_STAT = #{downStat},</if>
- <if test="dataStat != null">DATA_STAT = #{dataStat},</if>
- <if test="collTime != null">COLL_TIME = #{collTime},</if>
- <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!--根据userid和批次id查询督查组-->
- <select id="findListByBatchIdAndUserId" resultType="cn.com.goldenwater.dcproj.model.BisInspGroup">
- select g.*
- from BIS_INSP_GROUP g
- 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 g.DATA_STAT = '1'
- and u.id = #{userId}
- and g.plna_id = #{code}
- </select>
- </mapper>
|