BisInspPblmPlistLogDao.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.BisInspPblmPlistLogDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPblmPlistLog" id="bisInspPblmPlistLogResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="pblmClistId" column="PBLM_CLIST_ID"/>
  7. <result property="orgId" column="ORG_ID"/>
  8. <result property="orgNm" column="ORG_NM"/>
  9. <result property="persId" column="PERS_ID"/>
  10. <result property="persName" column="PERS_NAME"/>
  11. <result property="state" column="STATE"/>
  12. <result property="stateNote" column="STATE_NOTE"/>
  13. <result property="note" column="NOTE"/>
  14. <result property="intm" column="INTM"/>
  15. <result property="uptm" column="UPTM"/>
  16. <result property="dataStat" column="DATA_STAT"/>
  17. <result property="auditResult" column="AUDIT_RESULT"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. PBLM_CLIST_ID,
  22. ORG_ID,
  23. ORG_NM,
  24. PERS_ID,
  25. PERS_NAME,
  26. STATE,
  27. STATE_NOTE,
  28. NOTE,
  29. INTM,
  30. UPTM,
  31. DATA_STAT,
  32. AUDIT_RESULT
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{pblmClistId},
  37. #{orgId},
  38. #{orgNm},
  39. #{persId},
  40. #{persName},
  41. #{state},
  42. #{stateNote},
  43. #{note},
  44. #{intm},
  45. #{uptm},
  46. #{dataStat},
  47. #{auditResult}
  48. </sql>
  49. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  50. <sql id="page_where">
  51. <trim prefix="where" prefixOverrides="and | or ">
  52. <if test="pblmClistId != null and pblmClistId != ''">and PBLM_CLIST_ID = #{pblmClistId}</if>
  53. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  54. <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
  55. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  56. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  57. <if test="state != null and state != ''">and STATE = #{state}</if>
  58. <if test="stateNote != null and stateNote != ''">and STATE_NOTE = #{stateNote}</if>
  59. <if test="auditResult != null and auditResult != ''">and AUDIT_RESULT = #{auditResult}</if>
  60. <if test="note != null and note != ''">and NOTE = #{note}</if>
  61. <if test="intm != null">and INTM = #{intm}</if>
  62. <if test="uptm != null">and UPTM = #{uptm}</if>
  63. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="bisInspPblmPlistLogResultMap" parameterType="String">
  67. select
  68. <include refid="table_columns"/>
  69. from BIS_INSP_PBLM_PLIST_LOG where ID = #{id}
  70. </select>
  71. <select id="getBy" resultMap="bisInspPblmPlistLogResultMap">
  72. select
  73. <include refid="table_columns"/>
  74. from BIS_INSP_PBLM_PLIST_LOG
  75. <include refid="page_where"/>
  76. </select>
  77. <select id="findAll" resultMap="bisInspPblmPlistLogResultMap">
  78. select
  79. <include refid="table_columns"/>
  80. from BIS_INSP_PBLM_PLIST_LOG
  81. </select>
  82. <select id="findList" resultMap="bisInspPblmPlistLogResultMap">
  83. select
  84. <include refid="table_columns"/>
  85. from BIS_INSP_PBLM_PLIST_LOG
  86. <include refid="page_where"/>
  87. order by intm asc
  88. </select>
  89. <select id="selectCount" resultType="int">
  90. select count(ID) from BIS_INSP_PBLM_PLIST_LOG
  91. <include refid="page_where"/>
  92. </select>
  93. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmPlistLog">
  94. insert into BIS_INSP_PBLM_PLIST_LOG(
  95. <include refid="table_columns"/>
  96. )
  97. values (
  98. <include refid="entity_properties"/>
  99. )
  100. </insert>
  101. <delete id="delete" parameterType="java.lang.String">
  102. update BIS_INSP_PBLM_PLIST_LOG set DATA_STAT='9' where ID = #{id}
  103. </delete>
  104. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmPlistLog">
  105. delete from BIS_INSP_PBLM_PLIST_LOG
  106. <include refid="page_where"/>
  107. </delete>
  108. <update id="deleteInFlag" parameterType="java.lang.String">
  109. update BIS_INSP_PBLM_PLIST_LOG set flag_valid = 0 where ID = #{id}
  110. </update>
  111. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmPlistLog">
  112. update BIS_INSP_PBLM_PLIST_LOG
  113. <trim prefix="set" suffixOverrides=",">
  114. <if test="pblmClistId != null and pblmClistId != ''">PBLM_CLIST_ID = #{pblmClistId},</if>
  115. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  116. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  117. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  118. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  119. <if test="state != null and state != ''">STATE = #{state},</if>
  120. <if test="stateNote != null and stateNote != ''">STATE_NOTE = #{stateNote},</if>
  121. <if test="note != null and note != ''">NOTE = #{note},</if>
  122. <if test="intm != null">INTM = #{intm},</if>
  123. <if test="uptm != null">UPTM = #{uptm},</if>
  124. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  125. </trim>
  126. <where>ID = #{id}</where>
  127. </update>
  128. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPblmPlistLog">
  129. update BIS_INSP_PBLM_PLIST_LOG
  130. <trim prefix="set" suffixOverrides=",">
  131. <if test="pblmClistId != null and pblmClistId != ''">PBLM_CLIST_ID = #{pblmClistId},</if>
  132. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  133. <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
  134. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  135. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  136. <if test="state != null and state != ''">STATE = #{state},</if>
  137. <if test="stateNote != null and stateNote != ''">STATE_NOTE = #{stateNote},</if>
  138. <if test="note != null and note != ''">NOTE = #{note},</if>
  139. <if test="intm != null">INTM = #{intm},</if>
  140. <if test="uptm != null">UPTM = #{uptm},</if>
  141. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  142. </trim>
  143. <include refid="page_where"/>
  144. </update>
  145. <!-- 其他自定义SQL -->
  146. <select id="getPblmById" resultMap="bisInspPblmPlistLogResultMap">
  147. <!-- 根据整改问题pblmPlist的Id获取 整改记录 -->
  148. select
  149. <include refid="table_columns"/>
  150. from BIS_INSP_PBLM_PLIST_LOG where PBLM_CLIST_ID = #{pblmPListId}
  151. order by INTM asc
  152. </select>
  153. </mapper>