ObjInspPblmsRsvrDao.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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.ObjInspPblmsRsvrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ObjInspPblmsRsvr" id="objInspPblmsRsvrResultMap">
  5. <result property="pguid" column="PGUID"/>
  6. <result property="sn" column="SN"/>
  7. <result property="inspPblmsName" column="INSP_PBLMS_NAME"/>
  8. <result property="inspObjType" column="INSP_OBJ_TYPE"/>
  9. <result property="sort1" column="SORT1"/>
  10. <result property="sort2" column="SORT2"/>
  11. <result property="relBasis" column="REL_BASIS"/>
  12. <result property="checkPoint" column="CHECK_POINT"/>
  13. <result property="pblmDesc" column="PBLM_DESC"/>
  14. <result property="inspPblmCate" column="INSP_PBLM_CATE"/>
  15. <result property="dataStat" column="DATA_STAT"/>
  16. <result property="collTime" column="COLL_TIME"/>
  17. <result property="recPers" column="REC_PERS"/>
  18. <result property="note" column="NOTE"/>
  19. <result property="type" column="TYPE"/>
  20. <result property="objInspPblms" column="OBJ_INSP_PBLMS"/>
  21. <result property="attach" column="ATTACH"/>
  22. <result property="snClass" column="SN_CLASS"/>
  23. <result property="sheet" column="SHEET"/>
  24. <result property="filename" column="FILENAME"/>
  25. <result property="snNum" column="SN_NUM"/>
  26. <result property="guid" column="GUID"/>
  27. </resultMap>
  28. <sql id="table_columns">
  29. PGUID,
  30. SN,
  31. INSP_PBLMS_NAME,
  32. INSP_OBJ_TYPE,
  33. SORT1,
  34. SORT2,
  35. REL_BASIS,
  36. CHECK_POINT,
  37. PBLM_DESC,
  38. INSP_PBLM_CATE,
  39. DATA_STAT,
  40. COLL_TIME,
  41. REC_PERS,
  42. NOTE,
  43. TYPE,
  44. OBJ_INSP_PBLMS,
  45. ATTACH,
  46. SN_CLASS,
  47. SHEET,
  48. FILENAME,
  49. SN_NUM,
  50. GUID
  51. </sql>
  52. <sql id="entity_properties">
  53. #{pguid},
  54. #{sn},
  55. #{inspPblmsName},
  56. #{inspObjType},
  57. #{sort1},
  58. #{sort2},
  59. #{relBasis},
  60. #{checkPoint},
  61. #{pblmDesc},
  62. #{inspPblmCate},
  63. #{dataStat},
  64. #{collTime},
  65. #{recPers},
  66. #{note},
  67. #{type},
  68. #{objInspPblms},
  69. #{attach},
  70. #{snClass},
  71. #{sheet},
  72. #{filename},
  73. #{snNum},
  74. #{guid}
  75. </sql>
  76. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  77. <sql id="page_where">
  78. <trim prefix="where" prefixOverrides="and | or ">
  79. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  80. <if test="inspPblmsName != null and inspPblmsName != ''">and INSP_PBLMS_NAME = #{inspPblmsName}</if>
  81. <if test="inspObjType != null and inspObjType != ''">and INSP_OBJ_TYPE = #{inspObjType}</if>
  82. <if test="sort1 != null and sort1 != ''">and SORT1 = #{sort1}</if>
  83. <if test="sort2 != null and sort2 != ''">and SORT2 = #{sort2}</if>
  84. <if test="relBasis != null and relBasis != ''">and REL_BASIS = #{relBasis}</if>
  85. <if test="checkPoint != null and checkPoint != ''">and CHECK_POINT = #{checkPoint}</if>
  86. <if test="pblmDesc != null and pblmDesc != ''">and PBLM_DESC = #{pblmDesc}</if>
  87. <if test="inspPblmCate != null and inspPblmCate != ''">and INSP_PBLM_CATE = #{inspPblmCate}</if>
  88. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  89. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  90. <if test="recPers != null and recPers != ''">and REC_PERS = #{recPers}</if>
  91. <if test="note != null and note != ''">and NOTE = #{note}</if>
  92. <if test="type != null and type != ''">and TYPE = #{type}</if>
  93. <if test="objInspPblms != null and objInspPblms != ''">and OBJ_INSP_PBLMS = #{objInspPblms}</if>
  94. <if test="attach != null and attach != ''">and ATTACH = #{attach}</if>
  95. <if test="snClass != null and snClass != ''">and SN_CLASS = #{snClass}</if>
  96. <if test="sheet != null and sheet != ''">and SHEET = #{sheet}</if>
  97. <if test="filename != null and filename != ''">and FILENAME = #{filename}</if>
  98. <if test="snNum != null and snNum != ''">and SN_NUM = #{snNum}</if>
  99. <if test="guid != null and guid != ''">and GUID = #{guid}</if>
  100. </trim>
  101. </sql>
  102. <select id="get" resultMap="objInspPblmsRsvrResultMap" parameterType="String" >
  103. select <include refid="table_columns" /> from obj_insp_pblms where GUID = #{id}
  104. </select>
  105. <!--obj_insp_pblms_new-->
  106. <select id="getOldBz" resultMap="objInspPblmsRsvrResultMap" parameterType="String" >
  107. select <include refid="table_columns" /> from obj_insp_pblms_new where GUID = #{id}
  108. </select>
  109. <select id="getBy" resultMap="objInspPblmsRsvrResultMap">
  110. select <include refid="table_columns" /> from obj_insp_pblms <include refid="page_where" />
  111. </select>
  112. <select id="findAll" resultMap="objInspPblmsRsvrResultMap">
  113. select <include refid="table_columns" /> from obj_insp_pblms
  114. </select>
  115. <select id="findList" resultMap="objInspPblmsRsvrResultMap">
  116. select <include refid="table_columns" /> from obj_insp_pblms <include refid="page_where" />
  117. </select>
  118. <select id="selectCount" resultType="int" >
  119. select count(ID) from obj_insp_pblms <include refid="page_where" />
  120. </select>
  121. <select id="findRsvrDto" resultType="cn.com.goldenwater.dcproj.model.RsvrDto">
  122. select pid as id ,ad_code from gw_pnm
  123. </select>
  124. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblmsRsvr">
  125. insert into obj_insp_pblms( <include refid="table_columns" /> )
  126. values ( <include refid="entity_properties" /> )
  127. </insert>
  128. <delete id="delete" parameterType="java.lang.String">
  129. delete from obj_insp_pblms where ID = #{id}
  130. </delete>
  131. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblmsRsvr">
  132. delete from obj_insp_pblms <include refid="page_where" />
  133. </delete>
  134. <update id="deleteInFlag" parameterType="java.lang.String">
  135. update obj_insp_pblms set flag_valid = 0 where ID = #{id}
  136. </update>
  137. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblmsRsvr">
  138. update obj_insp_pblms
  139. <trim prefix="set" suffixOverrides=",">
  140. <if test="sn != null and sn != ''">SN = #{sn},</if>
  141. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  142. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  143. <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
  144. <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
  145. <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
  146. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  147. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  148. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  149. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  150. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  151. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  152. <if test="note != null and note != ''">NOTE = #{note},</if>
  153. <if test="type != null and type != ''">TYPE = #{type},</if>
  154. <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
  155. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  156. <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
  157. <if test="sheet != null and sheet != ''">SHEET = #{sheet},</if>
  158. <if test="filename != null and filename != ''">FILENAME = #{filename},</if>
  159. <if test="snNum != null and snNum != ''">SN_NUM = #{snNum},</if>
  160. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  161. </trim>
  162. <where>ID = #{id}</where>
  163. </update>
  164. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ObjInspPblmsRsvr">
  165. update obj_insp_pblms
  166. <trim prefix="set" suffixOverrides=",">
  167. <if test="sn != null and sn != ''">SN = #{sn},</if>
  168. <if test="inspPblmsName != null and inspPblmsName != ''">INSP_PBLMS_NAME = #{inspPblmsName},</if>
  169. <if test="inspObjType != null and inspObjType != ''">INSP_OBJ_TYPE = #{inspObjType},</if>
  170. <if test="sort1 != null and sort1 != ''">SORT1 = #{sort1},</if>
  171. <if test="sort2 != null and sort2 != ''">SORT2 = #{sort2},</if>
  172. <if test="relBasis != null and relBasis != ''">REL_BASIS = #{relBasis},</if>
  173. <if test="checkPoint != null and checkPoint != ''">CHECK_POINT = #{checkPoint},</if>
  174. <if test="pblmDesc != null and pblmDesc != ''">PBLM_DESC = #{pblmDesc},</if>
  175. <if test="inspPblmCate != null and inspPblmCate != ''">INSP_PBLM_CATE = #{inspPblmCate},</if>
  176. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  177. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  178. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  179. <if test="note != null and note != ''">NOTE = #{note},</if>
  180. <if test="type != null and type != ''">TYPE = #{type},</if>
  181. <if test="objInspPblms != null and objInspPblms != ''">OBJ_INSP_PBLMS = #{objInspPblms},</if>
  182. <if test="attach != null and attach != ''">ATTACH = #{attach},</if>
  183. <if test="snClass != null and snClass != ''">SN_CLASS = #{snClass},</if>
  184. <if test="sheet != null and sheet != ''">SHEET = #{sheet},</if>
  185. <if test="filename != null and filename != ''">FILENAME = #{filename},</if>
  186. <if test="snNum != null and snNum != ''">SN_NUM = #{snNum},</if>
  187. <if test="guid != null and guid != ''">GUID = #{guid},</if>
  188. </trim>
  189. <include refid="page_where" />
  190. </update>
  191. <!-- 其他自定义SQL -->
  192. </mapper>