BisInspAnzeRecordDao.xml 7.4 KB

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