| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?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.TacObjSubjectDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacObjSubject" id="tacObjSubjectResultMap">
- <result property="id" column="ID"/>
- <result property="subName" column="SUB_NAME"/>
- <result property="note" column="NOTE"/>
- <result property="intm" column="INTM"/>
- <result property="sysType" column="SYS_TYPE"/>
- <result property="sysName" column="SYS_NAME"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- SUB_NAME,
- NOTE,
- INTM,SYS_TYPE,SYS_NAME
- </sql>
- <sql id="entity_properties">
- #{id},
- #{subName},
- #{note},
- #{intm},#{sysType},#{sysName}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="subName != null and subName != ''">and SUB_NAME like '%${subName}%'</if>
- <if test="note != null and note != ''">and NOTE like '%${note}%'</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="ids != null and ids !=''">and id in (${ids})</if>
- <if test="sysType != null and sysType !=''">and sys_Type=#{sysType}</if>
- <if test="sysName != null and sysName !=''">and SYS_NAME like '${sysName}%'</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacObjSubjectResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from TAC_OBJ_SUBJECT where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacObjSubjectResultMap">
- select
- <include refid="table_columns"/>
- from TAC_OBJ_SUBJECT
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="tacObjSubjectResultMap">
- select
- <include refid="table_columns"/>
- from TAC_OBJ_SUBJECT
- </select>
- <select id="findList" resultMap="tacObjSubjectResultMap">
- select
- <include refid="table_columns"/>
- from TAC_OBJ_SUBJECT
- <include refid="page_where"/>
- </select>
- <select id="listType" resultMap="tacObjSubjectResultMap" >
- select distinct t.sys_type,t.sys_name from tac_obj_subject t where t.sys_type is not null
- </select>
- <select id="selectCount" resultType="int">
- select SEQ_GE_SLDC_NEXT.nextval from dual
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
- insert into TAC_OBJ_SUBJECT(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_OBJ_SUBJECT where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
- delete from TAC_OBJ_SUBJECT
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_OBJ_SUBJECT set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
- update TAC_OBJ_SUBJECT
- <trim prefix="set" suffixOverrides=",">
- <if test="subName != null and subName != ''">SUB_NAME = #{subName},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="sysName != null">sys_name = #{sysName},</if>
- <if test="sysType != null">SYS_TYPE = #{sysType},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
- update TAC_OBJ_SUBJECT
- <trim prefix="set" suffixOverrides=",">
- <if test="subName != null and subName != ''">SUB_NAME = #{subName},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="sysName != null">sys_name = #{sysName},</if>
- <if test="sysType != null">SYS_TYPE = #{sysType},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|