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