| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?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.ChkSafeSelsProjDao">
-
- <resultMap type="cn.com.goldenwater.dcproj.model.ChkSafeSelsProj" id="chkSafeSelsProjResultMap">
- <result property="id" column="ID" />
- <result property="pid" column="PID" />
- <result property="useScope" column="USE_SCOPE" />
- <result property="projType" column="PROJ_TYPE" />
- <result property="ordr" column="ORDR" />
- <result property="note" column="NOTE" />
- <result property="persId" column="PERS_ID" />
- <result property="intm" column="INTM" />
- <result property="uptm" column="UPTM" />
- <result property="dataStat" column="DATA_STAT" />
- </resultMap>
- <!-- 数据库表字段列表 table_columns -->
- <sql id="table_columns">
- ID, PID, USE_SCOPE,PROJ_TYPE, ORDR, NOTE, PERS_ID, INTM, UPTM, DATA_STAT </sql>
- <!-- 实体类属性 列表 entity_properties -->
- <sql id="entity_properties">
- #{id},
- #{pid},
- #{useScope},
- #{projType},
- #{ordr},
- #{note},
- #{persId},
- #{intm},
- #{uptm},
- #{dataStat}
- </sql>
- <!-- 查询条件 -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test='pid != null and pid != ""'> and PID = #{pid}</if>
- <if test='useScope != null and useScope != ""'> and USE_SCOPE = #{useScope}</if>
- <if test='projType != null and projType != ""'> and PROJ_TYPE = #{projType}</if>
- <if test='ordr != null '> and ORDR = #{ordr}</if>
- <if test='note != null and note != ""'> and NOTE = #{note}</if>
- <if test='persId != null and persId != ""'> and PERS_ID = #{persId}</if>
- <if test='intm != null '> and INTM = #{intm}</if>
- <if test='uptm != null '> and UPTM = #{uptm}</if>
- <if test='dataStat != null and dataStat != ""'> and DATA_STAT = #{dataStat}</if>
- </trim>
- </sql>
- <!-- 根据Id查询 -->
- <select id="get" resultMap="chkSafeSelsProjResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ where ID = #{id}
- </select>
- <!-- 根据条件筛选查询 -->
- <select id="getBy" resultMap="chkSafeSelsProjResultMap" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeSelsProjParam">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ
- <include refid="page_where"/>
- </select>
- <!-- 查询所有 -->
- <select id="findAll" resultMap="chkSafeSelsProjResultMap">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ
- order by USE_SCOPE asc, ORDR asc
- </select>
- <!-- 根据条件筛选 查询所有 -->
- <select id="findList" resultMap="chkSafeSelsProjResultMap" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeSelsProjParam">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ
- <include refid="page_where"/>
- order by ORDR asc
- </select>
- <!-- 根据条件筛选 统计记录数 -->
- <select id="selectCount" resultType="int" parameterType="cn.com.goldenwater.dcproj.param.ChkSafeSelsProjParam">
- select count( ID ) from CHK_SAFE_SELS_PROJ
- <include refid="page_where"/>
- </select>
- <!-- 添加 -->
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeSelsProj" >
- insert into CHK_SAFE_SELS_PROJ(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <!-- 主键删除 -->
- <delete id="delete" parameterType="java.lang.String">
- update CHK_SAFE_SELS_PROJ set DATA_STAT='9' where ID = #{id}
- </delete>
- <!-- 条件删除 -->
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeSelsProj">
- update CHK_SAFE_SELS_PROJ set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <!-- 逻辑删除 -->
- <update id="deleteInFlag" parameterType="java.lang.String">
- update CHK_SAFE_SELS_PROJ set DATA_STAT = '9' where ID = #{id}
- </update>
- <!-- 主键更新 -->
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeSelsProj">
- update CHK_SAFE_SELS_PROJ
- <trim prefix="SET" suffixOverrides=",">
- <if test='pid != null'>PID = #{pid},</if>
- <if test='useScope != null'>USE_SCOPE = #{useScope},</if>
- <if test='projType != null'>PROJ_TYPE = #{projType},</if>
- <if test='ordr != null'>ORDR = #{ordr},</if>
- <if test='note != null'>NOTE = #{note},</if>
- <if test='uptm != null'>UPTM = #{uptm},</if>
- <if test='dataStat != null'>DATA_STAT = #{dataStat},</if>
- </trim>
- where ID = #{id}
- </update>
- <!-- 条件更新 -->
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ChkSafeSelsProj">
- update CHK_SAFE_SELS_PROJ
- <trim prefix="SET" suffixOverrides=",">
- <if test='pid != null'>PID = #{pid},</if>
- <if test='useScope != null'>USE_SCOPE = #{useScope},</if>
- <if test='projType != null'>PROJ_TYPE = #{projType},</if>
- <if test='ordr != null'>ORDR = #{ordr},</if>
- <if test='note != null'>NOTE = #{note},</if>
- <if test='uptm != null'>UPTM = #{uptm},</if>
- <if test='dataStat != null'>DATA_STAT = #{dataStat},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <!-- 查询所有根节点 PID 为空 -->
- <!-- 查询专项检查表的所有根节点 PID 为空 -->
- <select id="findSIRootList" resultMap="chkSafeSelsProjResultMap">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ where USE_SCOPE='1' and PID is null and DATA_STAT = '0'
- order by ORDR asc
- </select>
- <!-- 查询监督检查台账表的根节点 PID 为空 -->
- <select id="findLedgerRootList" resultMap="chkSafeSelsProjResultMap">
- select
- <include refid="table_columns"/>
- from CHK_SAFE_SELS_PROJ where USE_SCOPE='2' and PID is null and DATA_STAT = '0'
- order by ORDR asc
- </select>
- </mapper>
|