BisInspStstnScoreDao.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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.BisInspStstnScoreDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspStstnScore" id="bisInspStstnScoreResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="caseId" column="CASE_ID"/>
  7. <result property="explain" column="EXPLAIN"/>
  8. <result property="expertNm" column="EXPERT_NM"/>
  9. <result property="expertId" column="EXPERT_ID"/>
  10. <result property="intm" column="INTM"/>
  11. <result property="uptm" column="UPTM"/>
  12. <result property="dataStat" column="DATA_STAT"/>
  13. <result property="scoreName" column="SCORE_NAME"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID,
  17. CASE_ID,
  18. EXPLAIN,
  19. EXPERT_NM,
  20. EXPERT_ID,
  21. INTM,
  22. UPTM,
  23. DATA_STAT,
  24. SCORE_NAME
  25. </sql>
  26. <sql id="entity_properties">
  27. #{id},
  28. #{caseId},
  29. #{explain},
  30. #{expertNm},
  31. #{expertId},
  32. #{intm},
  33. #{uptm},
  34. #{dataStat},
  35. #{scoreName}
  36. </sql>
  37. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  38. <sql id="page_where">
  39. <trim prefix="where" prefixOverrides="and | or ">
  40. <if test="caseId != null and caseId != ''">
  41. and CASE_ID = #{caseId}
  42. </if>
  43. <if test="explain != null and explain != ''">
  44. and EXPLAIN = #{explain}
  45. </if>
  46. <if test="expertNm != null and expertNm != ''">
  47. and EXPERT_NM = #{expertNm}
  48. </if>
  49. <if test="expertId != null and expertId != ''">
  50. and EXPERT_ID = #{expertId}
  51. </if>
  52. <if test="intm != null">
  53. and INTM = #{intm}
  54. </if>
  55. <if test="uptm != null">
  56. and UPTM = #{uptm}
  57. </if>
  58. <if test="dataStat != null and dataStat != ''">
  59. and DATA_STAT = #{dataStat}
  60. </if>
  61. <if test="scoreName != null and scoreName != ''">
  62. and SCORE_NAME = #{scoreName}
  63. </if>
  64. and DATA_STAT='0'
  65. </trim>
  66. </sql>
  67. <select id="get" resultMap="bisInspStstnScoreResultMap" parameterType="String">
  68. select
  69. <include refid="table_columns"/>
  70. from BIS_INSP_STSTN_SCORE where ID = #{id}
  71. </select>
  72. <select id="getBy" resultMap="bisInspStstnScoreResultMap">
  73. select
  74. <include refid="table_columns"/>
  75. from BIS_INSP_STSTN_SCORE
  76. <include refid="page_where"/>
  77. </select>
  78. <select id="findAll" resultMap="bisInspStstnScoreResultMap">
  79. select
  80. <include refid="table_columns"/>
  81. from BIS_INSP_STSTN_SCORE
  82. </select>
  83. <select id="findList" resultMap="bisInspStstnScoreResultMap">
  84. select
  85. <include refid="table_columns"/>
  86. from BIS_INSP_STSTN_SCORE
  87. <include refid="page_where"/>
  88. </select>
  89. <select id="selectCount" resultType="int">
  90. select count(ID) from BIS_INSP_STSTN_SCORE
  91. <include refid="page_where"/>
  92. </select>
  93. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstnScore">
  94. insert into BIS_INSP_STSTN_SCORE(
  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_STSTN_SCORE set DATA_STAT='9' where ID = #{id}
  103. </delete>
  104. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstnScore">
  105. update BIS_INSP_STSTN_SCORE set DATA_STAT='9'
  106. <include refid="page_where"/>
  107. </delete>
  108. <update id="deleteInFlag" parameterType="java.lang.String">
  109. update BIS_INSP_STSTN_SCORE set DATA_STAT = '9' where ID = #{id}
  110. </update>
  111. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstnScore">
  112. update BIS_INSP_STSTN_SCORE
  113. <trim prefix="set" suffixOverrides=",">
  114. <if test="caseId != null and caseId != ''">CASE_ID
  115. = #{caseId},
  116. </if>
  117. <if test="explain != null and explain != ''">EXPLAIN
  118. = #{explain},
  119. </if>
  120. <if test="expertNm != null and expertNm != ''">EXPERT_NM
  121. = #{expertNm},
  122. </if>
  123. <if test="expertId != null and expertId != ''">EXPERT_ID
  124. = #{expertId},
  125. </if>
  126. <if test="intm != null">INTM
  127. = #{intm},
  128. </if>
  129. <if test="uptm != null">UPTM
  130. = #{uptm},
  131. </if>
  132. <if test="dataStat != null and dataStat != ''">DATA_STAT
  133. = #{dataStat},
  134. </if>
  135. <if test="scoreName != null and scoreName != ''">SCORE_NAME
  136. = #{scoreName},
  137. </if>
  138. </trim>
  139. <where>ID = #{id}</where>
  140. </update>
  141. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspStstnScore">
  142. update BIS_INSP_STSTN_SCORE
  143. <trim prefix="set" suffixOverrides=",">
  144. <if test="caseId != null and caseId != ''">CASE_ID
  145. = #{caseId},
  146. </if>
  147. <if test="explain != null and explain != ''">EXPLAIN
  148. = #{explain},
  149. </if>
  150. <if test="expertNm != null and expertNm != ''">EXPERT_NM
  151. = #{expertNm},
  152. </if>
  153. <if test="expertId != null and expertId != ''">EXPERT_ID
  154. = #{expertId},
  155. </if>
  156. <if test="intm != null">INTM
  157. = #{intm},
  158. </if>
  159. <if test="uptm != null">UPTM
  160. = #{uptm},
  161. </if>
  162. <if test="dataStat != null and dataStat != ''">DATA_STAT
  163. = #{dataStat},
  164. </if>
  165. <if test="scoreName != null and scoreName != ''">SCORE_NAME
  166. = #{scoreName},
  167. </if>
  168. </trim>
  169. <include refid="page_where"/>
  170. </update>
  171. <!-- 其他自定义SQL -->
  172. <select id="getByCaseScore" resultMap="bisInspStstnScoreResultMap" parameterType="String">
  173. select
  174. <include refid="table_columns"/>
  175. from BIS_INSP_STSTN_SCORE where CASE_ID = #{caseId} and SCORE_NAME = #{scoreName}
  176. </select>
  177. </mapper>