ObjKeyPblmRelDao.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.ObjKeyPblmRelDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel" id="objKeyPblmRelResultMap">
  5. <result property="type" column="TYPE"/>
  6. <result property="proType" column="PRO_TYPE"/>
  7. <result property="reviOrg" column="REVI_ORG"/>
  8. <result property="pblmType" column="PBLM_TYPE"/>
  9. <result property="pblmPoint" column="PBLM_POINT"/>
  10. <result property="pblmAttach" column="PBLM_ATTACH"/>
  11. <result property="pblmSn" column="PBLM_SN"/>
  12. <result property="orgType" column="ORG_TYPE"/>
  13. <result property="pblmAttachName" column="PBLM_ATTACH_NAME"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. TYPE,
  17. PRO_TYPE,
  18. REVI_ORG,
  19. PBLM_TYPE,
  20. PBLM_POINT,
  21. PBLM_ATTACH,
  22. PBLM_SN,ORG_TYPE,PBLM_ATTACH_NAME
  23. </sql>
  24. <sql id="entity_properties">
  25. #{type},
  26. #{proType},
  27. #{reviOrg},
  28. #{pblmType},
  29. #{pblmPoint},
  30. #{pblmAttach},
  31. #{pblmSn},#{orgType},#{pblmAttachName}
  32. </sql>
  33. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  34. <sql id="page_where">
  35. <trim prefix="where" prefixOverrides="and | or ">
  36. <if test="proType != null and proType != ''">and PRO_TYPE = #{proType}</if>
  37. <if test="reviOrg != null and reviOrg != ''">and REVI_ORG = #{reviOrg}</if>
  38. <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
  39. <if test="pblmPoint != null and pblmPoint != ''">and PBLM_POINT = #{pblmPoint}</if>
  40. <if test="pblmAttach != null and pblmAttach != ''">and PBLM_ATTACH = #{pblmAttach}</if>
  41. <if test="pblmSn != null and pblmSn != ''">and PBLM_SN = #{pblmSn}</if>
  42. <if test="orgType != null and orgType != ''">and ORG_TYPE = #{orgType}</if>
  43. </trim>
  44. </sql>
  45. <select id="convertGroup" resultMap="objKeyPblmRelResultMap"
  46. parameterType="cn.com.goldenwater.dcproj.param.ObjKeyPblmRelParam">
  47. select group_concat(l.pblm_attach) as pblm_attach,pblm_type,group_concat(l.pblm_attach_name) as
  48. 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
  49. where l.pro_type=#{proType}
  50. <if test="orgType != null and orgType != ''">
  51. and l.org_Type=#{orgType}
  52. </if>
  53. <if test="reviOrg != null and reviOrg != ''">and REVI_ORG = #{reviOrg}</if>
  54. <if test="pblmType != null and pblmType != ''">and pblm_Type = #{pblmType}</if>
  55. <if test="pblmPoint != null and pblmPoint != ''">and pblm_Point = #{pblmPoint}</if>
  56. group by l.pro_type,l.pblm_point, l.pblm_type,l.revi_org
  57. </select>
  58. <select id="findOrgType" resultType="cn.com.goldenwater.dcproj.dto.BisInspKeyRegSecDicDto">
  59. 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
  60. revi_org,org_type order by org_type
  61. </select>
  62. <select id="get" resultMap="objKeyPblmRelResultMap" parameterType="String">
  63. select
  64. <include refid="table_columns"/>
  65. from obj_key_pblm_rel where ID = #{id}
  66. </select>
  67. <select id="getBy" resultMap="objKeyPblmRelResultMap">
  68. select
  69. <include refid="table_columns"/>
  70. from obj_key_pblm_rel
  71. <include refid="page_where"/>
  72. </select>
  73. <select id="findAll" resultMap="objKeyPblmRelResultMap">
  74. select
  75. <include refid="table_columns"/>
  76. from obj_key_pblm_rel
  77. </select>
  78. <select id="findProType" resultMap="objKeyPblmRelResultMap" parameterType="java.lang.String">
  79. select revi_org, org_type from obj_key_pblm_rel l
  80. where l.pro_type=#{proType} group by revi_org,org_type
  81. </select>
  82. <select id="findList" resultMap="objKeyPblmRelResultMap">
  83. select
  84. <include refid="table_columns"/>
  85. from obj_key_pblm_rel
  86. <include refid="page_where"/>
  87. </select>
  88. <select id="findPblmType" resultMap="objKeyPblmRelResultMap"
  89. parameterType="cn.com.goldenwater.dcproj.param.KeyRegParam">
  90. select distinct pblm_type from obj_key_pblm_rel l where l.pro_type=#{proType}
  91. <if test="orgType != null and orgType != ''">
  92. and l.org_type=#{orgType}
  93. </if>
  94. <if test="reviOrg !=null and reviOrg!=''">
  95. and l.revi_Org=#{reviOrg}
  96. </if>
  97. </select>
  98. <select id="selectCount" resultType="int">
  99. select count(ID) from obj_key_pblm_rel
  100. <include refid="page_where"/>
  101. </select>
  102. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
  103. insert into obj_key_pblm_rel(
  104. <include refid="table_columns"/>
  105. )
  106. values (
  107. <include refid="entity_properties"/>
  108. )
  109. </insert>
  110. <delete id="delete" parameterType="java.lang.String">
  111. delete from obj_key_pblm_rel where ID = #{id}
  112. </delete>
  113. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
  114. delete from obj_key_pblm_rel
  115. <include refid="page_where"/>
  116. </delete>
  117. <update id="deleteInFlag" parameterType="java.lang.String">
  118. update obj_key_pblm_rel set flag_valid = 0 where ID = #{id}
  119. </update>
  120. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
  121. update obj_key_pblm_rel
  122. <trim prefix="set" suffixOverrides=",">
  123. <if test="proType != null and proType != ''">PRO_TYPE = #{proType},</if>
  124. <if test="reviOrg != null and reviOrg != ''">REVI_ORG = #{reviOrg},</if>
  125. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  126. <if test="pblmPoint != null and pblmPoint != ''">PBLM_POINT = #{pblmPoint},</if>
  127. <if test="pblmAttach != null and pblmAttach != ''">PBLM_ATTACH = #{pblmAttach},</if>
  128. <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
  129. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  130. </trim>
  131. <where>ID = #{id}</where>
  132. </update>
  133. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblmRel">
  134. update obj_key_pblm_rel
  135. <trim prefix="set" suffixOverrides=",">
  136. <if test="proType != null and proType != ''">PRO_TYPE = #{proType},</if>
  137. <if test="reviOrg != null and reviOrg != ''">REVI_ORG = #{reviOrg},</if>
  138. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  139. <if test="pblmPoint != null and pblmPoint != ''">PBLM_POINT = #{pblmPoint},</if>
  140. <if test="pblmAttach != null and pblmAttach != ''">PBLM_ATTACH = #{pblmAttach},</if>
  141. <if test="pblmSn != null and pblmSn != ''">PBLM_SN = #{pblmSn},</if>
  142. <if test="orgType != null and orgType != ''">ORG_TYPE = #{orgType},</if>
  143. </trim>
  144. <include refid="page_where"/>
  145. </update>
  146. <!-- 其他自定义SQL -->
  147. </mapper>