ObjKeyPblmsDao.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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.ObjKeyPblmsDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ObjKeyPblms" id="objKeyPblmsResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="sn" column="SN"/>
  7. <result property="attachType" column="ATTACH_TYPE"/>
  8. <result property="pblmType" column="PBLM_TYPE"/>
  9. <result property="attach" column="ATTACH"/>
  10. <result property="sheet" column="SHEET"/>
  11. <result property="sheetName" column="SHEET_NAME"/>
  12. <result property="inspPblmsName" column="INSP_PBLMS_NAME"/>
  13. <result property="checkPoint" column="CHECK_POINT"/>
  14. <result property="pblmDesc" column="PBLM_DESC"/>
  15. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  16. <result property="attachName" column="ATTACH_NAME"/>
  17. <result property="className" column="CLASS_NAME"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. SN,
  22. ATTACH_TYPE,
  23. PBLM_TYPE,
  24. ATTACH,
  25. SHEET,
  26. SHEET_NAME,
  27. INSP_PBLMS_NAME,
  28. CHECK_POINT,
  29. PBLM_DESC,
  30. INSP_PBLM_CATE,ATTACH_NAME,CLASS_NAME
  31. </sql>
  32. <sql id="entity_properties">
  33. #{id},
  34. #{sn},
  35. #{attachType},
  36. #{pblmType},
  37. #{attach},
  38. #{sheet},
  39. #{sheetName},
  40. #{inspPblmsName},
  41. #{checkPoint},
  42. #{pblmDesc},
  43. #{inspPblmCate},#{attachName},#{className}
  44. </sql>
  45. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  46. <sql id="page_where">
  47. <trim prefix="where" prefixOverrides="and | or ">
  48. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  49. <if test="className != null and className != ''">and CLASS_NAME = #{className}</if>
  50. <if test="attachType != null and attachType != ''">and ATTACH_TYPE = #{attachType}</if>
  51. <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
  52. <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
  53. <if test="sheet != null and sheet != ''">and SHEET = #{sheet}</if>
  54. <if test="sheetName != null and sheetName != ''">and SHEET_NAME = #{sheetName}</if>
  55. <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
  56. <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT = #{checkPoint}</if>
  57. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  58. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  59. <if test="attachName != null and attachName != ''">and ATTACH_NAME = #{attachName}</if>
  60. </trim>
  61. </sql>
  62. <select id="findKeyPblmsNew" resultType="cn.com.goldenwater.dcproj.model.ObjKeyPblms"
  63. parameterType="cn.com.goldenwater.dcproj.param.ObjKeyPblmsParam">
  64. select
  65. <include refid="table_columns"/>
  66. from obj_key_pblms where 1=1
  67. <if test="sn !=null and sn !=''">
  68. and sn in (${sn})
  69. </if>
  70. <if test="attachType != null and attachType != ''">and ATTACH_TYPE = #{attachType}</if>
  71. <if test="sheetName != null and sheetName != ''">and sheet_name like '%${sheetName}%'</if>
  72. <if test="pblmType != null and pblmType != ''">and PBLM_TYPE = #{pblmType}</if>
  73. <if test="attach != null and attach != ''">and trim(ATTACH) = #{attach}</if>
  74. <if test="checkPoint != null and checkPoint != ''">and check_Point = #{checkPoint}</if>
  75. <if test="sheet != null and sheet != ''">and trim(SHEET) = #{sheet}</if>
  76. <if test="className != null and className != ''">and CLASS_NAME = #{className}</if>
  77. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC like '%${pblmDesc}%'</if>
  78. order by sn
  79. </select>
  80. <select id="get" resultMap="objKeyPblmsResultMap" parameterType="String">
  81. select
  82. <include refid="table_columns"/>
  83. from obj_key_pblms where ID = #{id}
  84. </select>
  85. <select id="getBy" resultMap="objKeyPblmsResultMap">
  86. select
  87. <include refid="table_columns"/>
  88. from obj_key_pblms
  89. <include refid="page_where"/>
  90. </select>
  91. <select id="findAll" resultMap="objKeyPblmsResultMap">
  92. select
  93. <include refid="table_columns"/>
  94. from obj_key_pblms
  95. </select>
  96. <select id="findList" resultMap="objKeyPblmsResultMap">
  97. select
  98. <include refid="table_columns"/>
  99. from obj_key_pblms
  100. <include refid="page_where"/>
  101. </select>
  102. <select id="selectCount" resultType="int">
  103. select count(ID) from obj_key_pblms
  104. <include refid="page_where"/>
  105. </select>
  106. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblms">
  107. insert into obj_key_pblms(
  108. <include refid="table_columns"/>
  109. )
  110. values (
  111. <include refid="entity_properties"/>
  112. )
  113. </insert>
  114. <delete id="delete" parameterType="java.lang.String">
  115. delete from obj_key_pblms where ID = #{id}
  116. </delete>
  117. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblms">
  118. delete from obj_key_pblms
  119. <include refid="page_where"/>
  120. </delete>
  121. <update id="deleteInFlag" parameterType="java.lang.String">
  122. update obj_key_pblms set flag_valid = 0 where ID = #{id}
  123. </update>
  124. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblms">
  125. update obj_key_pblms
  126. <trim prefix="set" suffixOverrides=",">
  127. <if test="sn != null and sn != ''">SN = #{sn},</if>
  128. <if test="attachType != null and attachType != ''">ATTACH_TYPE = #{attachType},</if>
  129. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  130. <if test="className != null and className != ''">CLASS_NAME = #{className},</if>
  131. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  132. <if test="sheet != null and sheet != ''">SHEET = #{sheet},</if>
  133. <if test="sheetName != null and sheetName != ''">SHEET_NAME = #{sheetName},</if>
  134. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  135. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  136. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  137. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  138. <if test="attachName != null and attachName != ''">ATTACH_NAME = #{attachName},</if>
  139. </trim>
  140. <where>ID = #{id}</where>
  141. </update>
  142. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjKeyPblms">
  143. update obj_key_pblms
  144. <trim prefix="set" suffixOverrides=",">
  145. <if test="sn != null and sn != ''">SN = #{sn},</if>
  146. <if test="attachType != null and attachType != ''">ATTACH_TYPE = #{attachType},</if>
  147. <if test="pblmType != null and pblmType != ''">PBLM_TYPE = #{pblmType},</if>
  148. <if test="className != null and className != ''">CLASS_NAME = #{className},</if>
  149. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  150. <if test="sheet != null and sheet != ''">SHEET = #{sheet},</if>
  151. <if test="sheetName != null and sheetName != ''">SHEET_NAME = #{sheetName},</if>
  152. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  153. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  154. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  155. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  156. <if test="attachName != null and attachName != ''">ATTACH_NAME = #{attachName},</if>
  157. </trim>
  158. <include refid="page_where"/>
  159. </update>
  160. <!-- 其他自定义SQL -->
  161. </mapper>