| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <?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.ObjKeyPblmRelDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel" id="objKeyPblmRelResultMap">
- <result property="type" column="TYPE"/>
- <result property="proType" column="PRO_TYPE"/>
- <result property="reviOrg" column="REVI_ORG"/>
- <result property="pblmType" column="PBLM_TYPE"/>
- <result property="pblmPoint" column="PBLM_POINT"/>
- <result property="pblmAttach" column="PBLM_ATTACH"/>
- <result property="pblmSn" column="PBLM_SN"/>
- <result property="orgType" column="ORG_TYPE"/>
- <result property="pblmAttachName" column="PBLM_ATTACH_NAME"/>
- </resultMap>
- <sql id="table_columns">
- TYPE,
- PRO_TYPE,
- REVI_ORG,
- PBLM_TYPE,
- PBLM_POINT,
- PBLM_ATTACH,
- PBLM_SN,ORG_TYPE,PBLM_ATTACH_NAME
- </sql>
- <sql id="entity_properties">
- #{type},
- #{proType},
- #{reviOrg},
- #{pblmType},
- #{pblmPoint},
- #{pblmAttach},
- #{pblmSn},#{orgType},#{pblmAttachName}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="proType != null and proType != ''">and PRO_TYPE = #{proType}</if>
- <if test="reviOrg != null and reviOrg != ''">and REVI_ORG = #{reviOrg}</if>
- <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
- <if test="pblmPoint != null and pblmPoint != ''">and PBLM_POINT = #{pblmPoint}</if>
- <if test="pblmAttach != null and pblmAttach != ''">and PBLM_ATTACH = #{pblmAttach}</if>
- <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
- <if test="orgType != null and orgType != ''">and ORG_TYPE = #{orgType}</if>
- </trim>
- </sql>
- <select id="convertGroup" resultMap="objKeyPblmRelResultMap"
- parameterType="cn.com.goldenwater.dcproj.param.ObjKeyPblmRelParam">
- select group_concat(l.pblm_attach) as pblm_attach,pblm_type,group_concat(l.pblm_attach_name) as
- pblm_attach_name,group_concat(l.pblm_sn) as pblm_sn,pblm_point,l.pro_type,l.revi_org from obj_key_pblm_rel l
- where l.pro_type=#{proType}
- <if test="orgType != null and orgType != ''">
- and l.org_Type=#{orgType}
- </if>
- <if test="reviOrg != null and reviOrg != ''">and REVI_ORG = #{reviOrg}</if>
- <if test="pblmType != null and pblmType != ''">and pblm_Type = #{pblmType}</if>
- <if test="pblmPoint != null and pblmPoint != ''">and pblm_Point = #{pblmPoint}</if>
- group by l.pro_type,l.pblm_point, l.pblm_type,l.revi_org
- </select>
- <select id="findOrgType" resultType="cn.com.goldenwater.dcproj.dto.BisInspKeyRegSecDicDto">
- select revi_org as dic_value, org_type as dic_key from obj_key_pblm_rel l where l.org_type is not null group by
- revi_org,org_type order by org_type
- </select>
- <select id="get" resultMap="objKeyPblmRelResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from obj_key_pblm_rel where ID = #{id}
- </select>
- <select id="getBy" resultMap="objKeyPblmRelResultMap">
- select
- <include refid="table_columns"/>
- from obj_key_pblm_rel
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="objKeyPblmRelResultMap">
- select
- <include refid="table_columns"/>
- from obj_key_pblm_rel
- </select>
- <select id="findProType" resultMap="objKeyPblmRelResultMap" parameterType="java.lang.String">
- select revi_org, org_type from obj_key_pblm_rel l
- where l.pro_type=#{proType} group by revi_org,org_type
- </select>
- <select id="findList" resultMap="objKeyPblmRelResultMap">
- select
- <include refid="table_columns"/>
- from obj_key_pblm_rel
- <include refid="page_where"/>
- </select>
- <select id="findPblmType" resultMap="objKeyPblmRelResultMap"
- parameterType="cn.com.goldenwater.dcproj.param.KeyRegParam">
- select distinct pblm_type from obj_key_pblm_rel l where l.pro_type=#{proType}
- <if test="orgType != null and orgType != ''">
- and l.org_type=#{orgType}
- </if>
- <if test="reviOrg !=null and reviOrg!=''">
- and l.revi_Org=#{reviOrg}
- </if>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from obj_key_pblm_rel
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
- insert into obj_key_pblm_rel(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from obj_key_pblm_rel where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
- delete from obj_key_pblm_rel
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update obj_key_pblm_rel set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
- update obj_key_pblm_rel
- <trim prefix="set" suffixOverrides=",">
- <if test="proType != null and proType != ''">PRO_TYPE = #{proType},</if>
- <if test="reviOrg != null and reviOrg != ''">REVI_ORG = #{reviOrg},</if>
- <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
- <if test="pblmPoint != null and pblmPoint != ''">PBLM_POINT = #{pblmPoint},</if>
- <if test="pblmAttach != null and pblmAttach != ''">PBLM_ATTACH = #{pblmAttach},</if>
- <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
- update obj_key_pblm_rel
- <trim prefix="set" suffixOverrides=",">
- <if test="proType != null and proType != ''">PRO_TYPE = #{proType},</if>
- <if test="reviOrg != null and reviOrg != ''">REVI_ORG = #{reviOrg},</if>
- <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
- <if test="pblmPoint != null and pblmPoint != ''">PBLM_POINT = #{pblmPoint},</if>
- <if test="pblmAttach != null and pblmAttach != ''">PBLM_ATTACH = #{pblmAttach},</if>
- <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
- <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|