BisInspSixmeRecordDao.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.BisInspSixmeRecordDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspSixmeRecord" id="bisInspSixmeRecordResultMap">
  5. <result property="uptm" column="UPTM"/>
  6. <result property="note" column="NOTE"/>
  7. <result property="dataStat" column="DATA_STAT"/>
  8. <result property="state" column="STATE"/>
  9. <result property="rgstrId" column="RGSTR_ID"/>
  10. <result property="search" column="SEARCH"/>
  11. <result property="judgment" column="JUDGMENT"/>
  12. <result property="earlyWarning" column="EARLY_WARNING"/>
  13. <result property="prevention" column="PREVENTION"/>
  14. <result property="disposal" column="DISPOSAL"/>
  15. <result property="responsibility" column="RESPONSIBILITY"/>
  16. <result property="persId" column="PERS_ID"/>
  17. <result property="intm" column="INTM"/>
  18. <result property="id" column="ID"/>
  19. </resultMap>
  20. <sql id="table_columns">
  21. UPTM,
  22. NOTE,
  23. DATA_STAT,
  24. STATE,
  25. RGSTR_ID,
  26. SEARCH,
  27. JUDGMENT,
  28. EARLY_WARNING,
  29. PREVENTION,
  30. DISPOSAL,
  31. RESPONSIBILITY,
  32. PERS_ID,
  33. INTM,
  34. ID
  35. </sql>
  36. <sql id="entity_properties">
  37. #{uptm},
  38. #{note},
  39. #{dataStat},
  40. #{state},
  41. #{rgstrId},
  42. #{search},
  43. #{judgment},
  44. #{earlyWarning},
  45. #{prevention},
  46. #{disposal},
  47. #{responsibility},
  48. #{persId},
  49. #{intm},
  50. #{id}
  51. </sql>
  52. <sql id="page_where">
  53. <trim prefix="where" prefixOverrides="and | or ">
  54. <if test="note != null and note != ''">and NOTE = #{note}</if>
  55. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  56. <if test="state != null and state != ''">and STATE = #{state}</if>
  57. <if test="rgstrId != null and rgstrId != ''">and RGSTR_ID = #{rgstrId}</if>
  58. <if test="search != null and search != ''">and SEARCH = #{search}</if>
  59. <if test="judgment != null and judgment != ''">and JUDGMENT = #{judgment}</if>
  60. <if test="earlyWarning != null and earlyWarning != ''">and EARLY_WARNING = #{earlyWarning}</if>
  61. <if test="prevention != null and prevention != ''">and PREVENTION = #{prevention}</if>
  62. <if test="disposal != null and disposal != ''">and DISPOSAL = #{disposal}</if>
  63. <if test="responsibility != null and responsibility != ''">and RESPONSIBILITY = #{responsibility}</if>
  64. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  65. <if test="intm != null">and INTM = #{intm}</if>
  66. <if test="id != null and id != ''">and ID = #{id}</if>
  67. and DATA_STAT='0'
  68. </trim>
  69. </sql>
  70. <select id="get" resultMap="bisInspSixmeRecordResultMap" parameterType="String" >
  71. select <include refid="table_columns" /> from BIS_INSP_SIXME_RECORD where ID = #{id}
  72. </select>
  73. <select id="getBy" resultMap="bisInspSixmeRecordResultMap">
  74. select <include refid="table_columns" /> from BIS_INSP_SIXME_RECORD <include refid="page_where" />
  75. </select>
  76. <select id="findAll" resultMap="bisInspSixmeRecordResultMap">
  77. select <include refid="table_columns" /> from BIS_INSP_SIXME_RECORD
  78. </select>
  79. <select id="findList" resultMap="bisInspSixmeRecordResultMap">
  80. select <include refid="table_columns" /> from BIS_INSP_SIXME_RECORD <include refid="page_where" />
  81. order by intm desc
  82. </select>
  83. <select id="selectCount" resultType="int" >
  84. select count(ID) from BIS_INSP_SIXME_RECORD <include refid="page_where" />
  85. </select>
  86. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspSixmeRecord">
  87. insert into BIS_INSP_SIXME_RECORD( <include refid="table_columns" /> )
  88. values ( <include refid="entity_properties" /> )
  89. </insert>
  90. <delete id="delete" parameterType="java.lang.String">
  91. update BIS_INSP_SIXME_RECORD set DATA_STAT='9' where ID = #{id}
  92. </delete>
  93. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspSixmeRecord">
  94. update BIS_INSP_SIXME_RECORD set DATA_STAT='9' <include refid="page_where" />
  95. </delete>
  96. <update id="deleteInFlag" parameterType="java.lang.String">
  97. update BIS_INSP_SIXME_RECORD set DATA_STAT = '9' where ID = #{id}
  98. </update>
  99. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspSixmeRecord">
  100. update BIS_INSP_SIXME_RECORD
  101. <trim prefix="set" suffixOverrides=",">
  102. <if test="note != null and note != ''">NOTE = #{note},</if>
  103. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  104. <if test="state != null and state != ''">STATE = #{state},</if>
  105. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  106. <if test="search != null and search != ''">SEARCH = #{search},</if>
  107. <if test="judgment != null and judgment != ''">JUDGMENT = #{judgment},</if>
  108. <if test="earlyWarning != null and earlyWarning != ''">EARLY_WARNING = #{earlyWarning},</if>
  109. <if test="prevention != null and prevention != ''">PREVENTION = #{prevention},</if>
  110. <if test="disposal != null and disposal != ''">DISPOSAL = #{disposal},</if>
  111. <if test="responsibility != null and responsibility != ''">RESPONSIBILITY = #{responsibility},</if>
  112. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  113. <if test="intm != null">INTM = #{intm},</if>
  114. <if test="id != null and id != ''">ID = #{id},</if>
  115. </trim>
  116. <where>ID = #{id}</where>
  117. </update>
  118. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspSixmeRecord">
  119. update BIS_INSP_SIXME_RECORD
  120. <trim prefix="set" suffixOverrides=",">
  121. <if test="note != null and note != ''">NOTE = #{note},</if>
  122. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  123. <if test="state != null and state != ''">STATE = #{state},</if>
  124. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID = #{rgstrId},</if>
  125. <if test="search != null and search != ''">SEARCH = #{search},</if>
  126. <if test="judgment != null and judgment != ''">JUDGMENT = #{judgment},</if>
  127. <if test="earlyWarning != null and earlyWarning != ''">EARLY_WARNING = #{earlyWarning},</if>
  128. <if test="prevention != null and prevention != ''">PREVENTION = #{prevention},</if>
  129. <if test="disposal != null and disposal != ''">DISPOSAL = #{disposal},</if>
  130. <if test="responsibility != null and responsibility != ''">RESPONSIBILITY = #{responsibility},</if>
  131. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  132. <if test="intm != null">INTM = #{intm},</if>
  133. <if test="id != null and id != ''">ID = #{id},</if>
  134. </trim>
  135. <include refid="page_where" />
  136. </update>
  137. <!-- 其他自定义SQL -->
  138. </mapper>