BisInspWiujsSupportDao.xml 6.1 KB

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