| 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.BisInspComPblmDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspComPblm" id="bisInspComPblmResultMap">
- <result property="cpId" column="CP_ID"/>
- <result property="cpTitle" column="CP_TITLE"/>
- <result property="cpDesc" column="CP_DESC"/>
- <result property="cpLgtd" column="CP_LGTD"/>
- <result property="cpLttd" column="CP_LTTD"/>
- <result property="cpIttm" column="CP_ITTM"/>
- <result property="cpRes" column="CP_RES"/>
- <result property="cpResnm" column="CP_RESNM"/>
- </resultMap>
- <sql id="table_columns">
- CP_ID,
- CP_TITLE,
- CP_DESC,
- CP_LGTD,
- CP_LTTD,
- CP_ITTM,
- CP_RES,
- CP_RESNM
- </sql>
- <sql id="entity_properties">
- #{cpId},
- #{cpTitle},
- #{cpDesc},
- #{cpLgtd},
- #{cpLttd},
- #{cpIttm},
- #{cpRes},
- #{cpResnm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="cpTitle != null and cpTitle != ''">and CP_TITLE = #{cpTitle}</if>
- <if test="cpDesc != null and cpDesc != ''">and CP_DESC = #{cpDesc}</if>
- <if test="cpLgtd != null and cpLgtd != ''">and CP_LGTD = #{cpLgtd}</if>
- <if test="cpLttd != null and cpLttd != ''">and CP_LTTD = #{cpLttd}</if>
- <if test="cpIttm != null">and CP_ITTM = #{cpIttm}</if>
- <if test="cpRes != null and cpRes != ''">and CP_RES = #{cpRes}</if>
- <if test="cpResnm != null and cpResnm != ''">and CP_RESNM = #{cpResnm}</if>
- </trim>
- </sql>
- <sql id="page_where2">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="cpTitle != null and cpTitle != ''">and CP_TITLE like '%' || #{cpTitle} || '%'</if>
- <if test="cpDesc != null and cpDesc != ''">and CP_DESC like '%' || #{cpDesc} || '%'</if>
- <if test="cpLgtd != null and cpLgtd != ''">and CP_LGTD = #{cpLgtd}</if>
- <if test="cpLttd != null and cpLttd != ''">and CP_LTTD = #{cpLttd}</if>
- <if test="sttm != null">and CP_ITTM >= #{sttm}</if>
- <if test="entm != null">and CP_ITTM <= #{entm}</if>
- <if test="cpRes != null and cpRes != ''">and CP_RES = #{cpRes}</if>
- <if test="cpResnm != null and cpResnm != ''">and CP_RESNM = #{cpResnm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspComPblmResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_COM_PBLM where CP_ID = #{cpId}
- </select>
- <select id="getBy" resultMap="bisInspComPblmResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_COM_PBLM
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspComPblmResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_COM_PBLM
- </select>
- <select id="findList" resultMap="bisInspComPblmResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_COM_PBLM
- <include refid="page_where2"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(CP_ID) from BIS_INSP_COM_PBLM
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
- insert into BIS_INSP_COM_PBLM(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_COM_PBLM where CP_ID = #{cpId}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
- delete from BIS_INSP_COM_PBLM
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_COM_PBLM set flag_valid = 0 where CP_ID = #{cpId}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
- update BIS_INSP_COM_PBLM
- <trim prefix="set" suffixOverrides=",">
- <if test="cpTitle != null and cpTitle != ''">CP_TITLE = #{cpTitle},</if>
- <if test="cpDesc != null and cpDesc != ''">CP_DESC = #{cpDesc},</if>
- <if test="cpLgtd != null and cpLgtd != ''">CP_LGTD = #{cpLgtd},</if>
- <if test="cpLttd != null and cpLttd != ''">CP_LTTD = #{cpLttd},</if>
- <if test="cpIttm != null">CP_ITTM = #{cpIttm},</if>
- <if test="cpRes != null and cpRes != ''">CP_RES = #{cpRes},</if>
- <if test="cpResnm != null and cpResnm != ''">CP_RESNM = #{cpResnm},</if>
- </trim>
- <where>CP_ID = #{cpId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspComPblm">
- update BIS_INSP_COM_PBLM
- <trim prefix="set" suffixOverrides=",">
- <if test="cpTitle != null and cpTitle != ''">CP_TITLE = #{cpTitle},</if>
- <if test="cpDesc != null and cpDesc != ''">CP_DESC = #{cpDesc},</if>
- <if test="cpLgtd != null and cpLgtd != ''">CP_LGTD = #{cpLgtd},</if>
- <if test="cpLttd != null and cpLttd != ''">CP_LTTD = #{cpLttd},</if>
- <if test="cpIttm != null">CP_ITTM = #{cpIttm},</if>
- <if test="cpRes != null and cpRes != ''">CP_RES = #{cpRes},</if>
- <if test="cpResnm != null and cpResnm != ''">CP_RESNM = #{cpResnm},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|