BisInspQaScore1Dao.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.BisInspQaScore1Dao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspQaScore1" id="bisInspQaScore1ResultMap">
  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="scoreName" column="SCORE_NAME"/>
  11. <result property="intm" column="INTM"/>
  12. <result property="uptm" column="UPTM"/>
  13. <result property="dataStat" column="DATA_STAT"/>
  14. </resultMap>
  15. <sql id="table_columns">
  16. ID,
  17. CASE_ID,
  18. EXPLAIN, EXPERT_NM, EXPERT_ID, SCORE_NAME, INTM, UPTM, DATA_STAT
  19. </sql>
  20. <sql id="entity_properties">
  21. #{id},
  22. #{caseId},
  23. #{explain},
  24. #{expertNm},
  25. #{expertId},
  26. #{scoreName},
  27. #{intm},
  28. #{uptm},
  29. #{dataStat}
  30. </sql>
  31. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  32. <sql id="page_where">
  33. <trim prefix="where" prefixOverrides="and | or ">
  34. <if test="caseId != null and caseId != ''">and CASE_ID = #{caseId}</if>
  35. <if test="explain != null and explain != ''">and EXPLAIN = #{explain}</if>
  36. <if test="expertNm != null and expertNm != ''">and EXPERT_NM = #{expertNm}</if>
  37. <if test="expertId != null and expertId != ''">and EXPERT_ID = #{expertId}</if>
  38. <if test="scoreName != null and scoreName != ''">and SCORE_NAME = #{scoreName}</if>
  39. <if test="intm != null">and INTM = #{intm}</if>
  40. <if test="uptm != null">and UPTM = #{uptm}</if>
  41. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  42. and DATA_STAT='0'
  43. </trim>
  44. </sql>
  45. <select id="get" resultMap="bisInspQaScore1ResultMap" parameterType="String">
  46. select
  47. <include refid="table_columns"/>
  48. from BIS_INSP_QA_SCORE1 where ID = #{id}
  49. </select>
  50. <select id="getBy" resultMap="bisInspQaScore1ResultMap">
  51. select
  52. <include refid="table_columns"/>
  53. from BIS_INSP_QA_SCORE1
  54. <include refid="page_where"/>
  55. </select>
  56. <select id="findAll" resultMap="bisInspQaScore1ResultMap">
  57. select
  58. <include refid="table_columns"/>
  59. from BIS_INSP_QA_SCORE1
  60. </select>
  61. <select id="findList" resultMap="bisInspQaScore1ResultMap">
  62. select
  63. <include refid="table_columns"/>
  64. from BIS_INSP_QA_SCORE1
  65. <include refid="page_where"/>
  66. </select>
  67. <select id="selectCount" resultType="int">
  68. select count(ID) from BIS_INSP_QA_SCORE1
  69. <include refid="page_where"/>
  70. </select>
  71. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspQaScore1">
  72. insert into BIS_INSP_QA_SCORE1(
  73. <include refid="table_columns"/>
  74. )
  75. values (
  76. <include refid="entity_properties"/>
  77. )
  78. </insert>
  79. <delete id="delete" parameterType="java.lang.String">
  80. update BIS_INSP_QA_SCORE1
  81. set DATA_STAT='9'
  82. where ID = #{id}
  83. </delete>
  84. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspQaScore1">
  85. update BIS_INSP_QA_SCORE1 set DATA_STAT='9'
  86. <include refid="page_where"/>
  87. </delete>
  88. <update id="deleteInFlag" parameterType="java.lang.String">
  89. update BIS_INSP_QA_SCORE1
  90. set DATA_STAT = '9'
  91. where ID = #{id}
  92. </update>
  93. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspQaScore1">
  94. update BIS_INSP_QA_SCORE1
  95. <trim prefix="set" suffixOverrides=",">
  96. <if test="caseId != null and caseId != ''">CASE_ID = #{caseId},</if>
  97. <if test="explain != null and explain != ''">EXPLAIN = #{explain},</if>
  98. <if test="expertNm != null and expertNm != ''">EXPERT_NM = #{expertNm},</if>
  99. <if test="expertId != null and expertId != ''">EXPERT_ID = #{expertId},</if>
  100. <if test="scoreName != null and scoreName != ''">SCORE_NAME = #{scoreName},</if>
  101. <if test="intm != null">INTM = #{intm},</if>
  102. <if test="uptm != null">UPTM = #{uptm},</if>
  103. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  104. </trim>
  105. <where>ID = #{id}</where>
  106. </update>
  107. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspQaScore1">
  108. update BIS_INSP_QA_SCORE1
  109. <trim prefix="set" suffixOverrides=",">
  110. <if test="caseId != null and caseId != ''">CASE_ID = #{caseId},</if>
  111. <if test="explain != null and explain != ''">EXPLAIN = #{explain},</if>
  112. <if test="expertNm != null and expertNm != ''">EXPERT_NM = #{expertNm},</if>
  113. <if test="expertId != null and expertId != ''">EXPERT_ID = #{expertId},</if>
  114. <if test="scoreName != null and scoreName != ''">SCORE_NAME = #{scoreName},</if>
  115. <if test="intm != null">INTM = #{intm},</if>
  116. <if test="uptm != null">UPTM = #{uptm},</if>
  117. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  118. </trim>
  119. <include refid="page_where"/>
  120. </update>
  121. <!-- 其他自定义SQL -->
  122. <select id="getByCaseScore" resultMap="bisInspQaScore1ResultMap" parameterType="String">
  123. select
  124. <include refid="table_columns"/>
  125. from BIS_INSP_QA_SCORE1 where CASE_ID = #{caseId} and SCORE_NAME = #{scoreName}
  126. </select>
  127. </mapper>