| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.RelOrgInspTypeDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.RelOrgInspType" id="relOrgInspTypeResultMap">
- <result property="id" column="ID"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="inspType" column="INSP_TYPE"/>
- <result property="inspName" column="INSP_NAME"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- ORG_ID,
- INSP_TYPE,
- INSP_NAME,
- INTM,
- UPTM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{orgId},
- #{inspType},
- #{inspName},
- #{intm},
- #{uptm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
- <if test="inspName != null and inspName != ''">and INSP_NAME = #{inspName}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="relOrgInspTypeResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from REL_ORG_INSP_TYPE where ID = #{id}
- </select>
- <select id="getBy" resultMap="relOrgInspTypeResultMap">
- select
- <include refid="table_columns"/>
- from REL_ORG_INSP_TYPE
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="relOrgInspTypeResultMap">
- select
- <include refid="table_columns"/>
- from REL_ORG_INSP_TYPE
- </select>
- <select id="findList" resultMap="relOrgInspTypeResultMap">
- select
- <include refid="table_columns"/>
- from REL_ORG_INSP_TYPE
- <include refid="page_where"/>
- order by to_number(insp_type)
- </select>
- <select id="selectCount" resultType="int">
- select nvl(count(ID),0) from REL_ORG_INSP_TYPE
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.RelOrgInspType">
- insert into REL_ORG_INSP_TYPE(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from REL_ORG_INSP_TYPE where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.RelOrgInspType">
- delete from REL_ORG_INSP_TYPE
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- delete from REL_ORG_INSP_TYPE where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.RelOrgInspType">
- update REL_ORG_INSP_TYPE
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="inspName != null and inspName != ''">INSP_NAME = #{inspName},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.RelOrgInspType">
- update REL_ORG_INSP_TYPE
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="inspName != null and inspName != ''">INSP_NAME = #{inspName},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="findListByUser" resultMap="relOrgInspTypeResultMap">
- select * from REL_ORG_INSP_TYPE where org_id =#{orgId} and insp_type in (select substr(id,0,3)
- from bis_insp_all_rlation where length(id)=6 and persid=#{persId} and org_id=#{orgId})
- order by to_number(insp_type)
- </select>
- <select id="listOfRgster" resultType="java.lang.String">
- SELECT A.RGSTR_TABLE_NAME
- FROM REL_ORG_INSP_TYPE R JOIN ATT_INSP_TYPE A ON A.CODE = R.INSP_TYPE
- WHERE R.ORG_ID = #{orgId}
- AND A.RGSTR_TABLE_NAME IS NOT NULL
- </select>
- <!-- 其他自定义SQL -->
- <select id="getInspTypeAll" resultType="cn.com.goldenwater.dcproj.model.RelOrgInspType">
- select NAME inspName,PTYPE inspType FROM ATT_INSP_TYPE
- </select>
- </mapper>
|