RiskManagementMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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="com.chinaitop.depot.risk.mapper.RiskManagementMapper">
  4. <select id="selectListPage" resultType="com.chinaitop.depot.risk.model.RiskManagement">
  5. select
  6. id,
  7. library_point_name as libraryPointName,
  8. identify_person as identifyPerson,
  9. link_part as linkPart,
  10. risk_classification as riskClassification,
  11. risk_type_id as riskTypeId,
  12. risk_type_name as riskTypeName,
  13. risk_identification as riskIdentification,
  14. accident_type as accidentType,
  15. risk_measures as riskMeasures,
  16. responsible_dept as responsibleDept,
  17. responsible_person as responsiblePerson,
  18. org_id as orgId,
  19. create_time as createTime
  20. from
  21. risk_management
  22. where
  23. org_id = #{orgId}
  24. <if test="startDate != null" >
  25. <![CDATA[ and create_time >= #{startDate} ]]>
  26. </if>
  27. <if test="endDate != null" >
  28. <![CDATA[ and create_time <= #{endDate} ]]>
  29. </if>
  30. </select>
  31. <insert id="insert">
  32. <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
  33. select seq_business_agent_tank.nextVal from dual
  34. </selectKey>
  35. INSERT INTO risk_management
  36. (id,library_point_name, identify_person, link_part, risk_classification, risk_type_id, risk_type_name, risk_identification,
  37. accident_type, risk_measures, responsible_dept, responsible_person, org_id, create_time)
  38. VALUES (#{id,jdbcType=INTEGER},
  39. #{libraryPointName,jdbcType=VARCHAR},
  40. #{identifyPerson,jdbcType=VARCHAR},
  41. #{linkPart,jdbcType=VARCHAR},
  42. #{riskClassification,jdbcType=VARCHAR},
  43. #{riskTypeId,jdbcType=INTEGER},
  44. #{riskTypeName,jdbcType=VARCHAR},
  45. #{riskIdentification,jdbcType=VARCHAR},
  46. #{accidentType,jdbcType=VARCHAR},
  47. #{riskMeasures,jdbcType=VARCHAR},
  48. #{responsibleDept,jdbcType=VARCHAR},
  49. #{responsiblePerson,jdbcType=VARCHAR},
  50. #{orgId,jdbcType=INTEGER},
  51. #{createTime,jdbcType=VARCHAR})
  52. </insert>
  53. <update id="updateById">
  54. UPDATE risk_management
  55. <set>
  56. <if test="libraryPointName != null">
  57. library_point_name = #{libraryPointName,jdbcType=VARCHAR},
  58. </if>
  59. <if test="identifyPerson != null">
  60. identify_person = #{identifyPerson,jdbcType=VARCHAR},
  61. </if>
  62. <if test="linkPart != null">
  63. link_part = #{linkPart,jdbcType=VARCHAR},
  64. </if>
  65. <if test="riskClassification != null">
  66. risk_classification = #{riskClassification,jdbcType=VARCHAR},
  67. </if>
  68. <if test="riskTypeId != null">
  69. risk_type_id = #{riskTypeId,jdbcType=INTEGER},
  70. </if>
  71. <if test="riskTypeName != null">
  72. risk_type_name = #{riskTypeName,jdbcType=VARCHAR},
  73. </if>
  74. <if test="riskIdentification != null">
  75. risk_identification = #{riskIdentification,jdbcType=VARCHAR},
  76. </if>
  77. <if test="accidentType != null">
  78. accident_type = #{accidentType,jdbcType=VARCHAR},
  79. </if>
  80. <if test="riskMeasures != null">
  81. risk_measures = #{riskMeasures,jdbcType=VARCHAR},
  82. </if>
  83. <if test="responsibleDept != null">
  84. responsible_dept = #{responsibleDept,jdbcType=VARCHAR},
  85. </if>
  86. <if test="responsiblePerson != null">
  87. responsible_person = #{responsiblePerson,jdbcType=VARCHAR},
  88. </if>
  89. <if test="modifyTime != null">
  90. modify_time = #{modifyTime,jdbcType=DATE},
  91. </if>
  92. </set>
  93. where id = #{id,jdbcType=INTEGER}
  94. </update>
  95. <select id="selectById" resultType="com.chinaitop.depot.risk.model.RiskManagement">
  96. select
  97. id,
  98. library_point_name as libraryPointName,
  99. identify_person as identifyPerson,
  100. link_part as linkPart,
  101. risk_classification as riskClassification,
  102. risk_type_id as riskTypeId,
  103. risk_type_name as riskTypeName,
  104. risk_identification as riskIdentification,
  105. accident_type as accidentType,
  106. risk_measures as riskMeasures,
  107. responsible_dept as responsibleDept,
  108. responsible_person as responsiblePerson,
  109. org_id as orgId,
  110. create_time as createTime,
  111. modify_time as modifyTime
  112. from
  113. risk_management
  114. where id = #{id,jdbcType=INTEGER}
  115. </select>
  116. <delete id="deleteById">
  117. delete from risk_management where id = #{id,jdbcType=INTEGER}
  118. </delete>
  119. </mapper>