| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.chinaitop.depot.risk.mapper.RiskManagementMapper">
- <select id="selectListPage" resultType="com.chinaitop.depot.risk.model.RiskManagement">
- select
- id,
- library_point_name as libraryPointName,
- identify_person as identifyPerson,
- link_part as linkPart,
- risk_classification as riskClassification,
- risk_type_id as riskTypeId,
- risk_type_name as riskTypeName,
- risk_identification as riskIdentification,
- accident_type as accidentType,
- risk_measures as riskMeasures,
- responsible_dept as responsibleDept,
- responsible_person as responsiblePerson,
- org_id as orgId,
- create_time as createTime
- from
- risk_management
- where
- org_id = #{orgId}
- <if test="startDate != null" >
- <![CDATA[ and create_time >= #{startDate} ]]>
- </if>
- <if test="endDate != null" >
- <![CDATA[ and create_time <= #{endDate} ]]>
- </if>
- </select>
- <insert id="insert">
- <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
- select seq_business_agent_tank.nextVal from dual
- </selectKey>
- INSERT INTO risk_management
- (id,library_point_name, identify_person, link_part, risk_classification, risk_type_id, risk_type_name, risk_identification,
- accident_type, risk_measures, responsible_dept, responsible_person, org_id, create_time)
- VALUES (#{id,jdbcType=INTEGER},
- #{libraryPointName,jdbcType=VARCHAR},
- #{identifyPerson,jdbcType=VARCHAR},
- #{linkPart,jdbcType=VARCHAR},
- #{riskClassification,jdbcType=VARCHAR},
- #{riskTypeId,jdbcType=INTEGER},
- #{riskTypeName,jdbcType=VARCHAR},
- #{riskIdentification,jdbcType=VARCHAR},
- #{accidentType,jdbcType=VARCHAR},
- #{riskMeasures,jdbcType=VARCHAR},
- #{responsibleDept,jdbcType=VARCHAR},
- #{responsiblePerson,jdbcType=VARCHAR},
- #{orgId,jdbcType=INTEGER},
- #{createTime,jdbcType=VARCHAR})
- </insert>
- <update id="updateById">
- UPDATE risk_management
- <set>
- <if test="libraryPointName != null">
- library_point_name = #{libraryPointName,jdbcType=VARCHAR},
- </if>
- <if test="identifyPerson != null">
- identify_person = #{identifyPerson,jdbcType=VARCHAR},
- </if>
- <if test="linkPart != null">
- link_part = #{linkPart,jdbcType=VARCHAR},
- </if>
- <if test="riskClassification != null">
- risk_classification = #{riskClassification,jdbcType=VARCHAR},
- </if>
- <if test="riskTypeId != null">
- risk_type_id = #{riskTypeId,jdbcType=INTEGER},
- </if>
- <if test="riskTypeName != null">
- risk_type_name = #{riskTypeName,jdbcType=VARCHAR},
- </if>
- <if test="riskIdentification != null">
- risk_identification = #{riskIdentification,jdbcType=VARCHAR},
- </if>
- <if test="accidentType != null">
- accident_type = #{accidentType,jdbcType=VARCHAR},
- </if>
- <if test="riskMeasures != null">
- risk_measures = #{riskMeasures,jdbcType=VARCHAR},
- </if>
- <if test="responsibleDept != null">
- responsible_dept = #{responsibleDept,jdbcType=VARCHAR},
- </if>
- <if test="responsiblePerson != null">
- responsible_person = #{responsiblePerson,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null">
- modify_time = #{modifyTime,jdbcType=DATE},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectById" resultType="com.chinaitop.depot.risk.model.RiskManagement">
- select
- id,
- library_point_name as libraryPointName,
- identify_person as identifyPerson,
- link_part as linkPart,
- risk_classification as riskClassification,
- risk_type_id as riskTypeId,
- risk_type_name as riskTypeName,
- risk_identification as riskIdentification,
- accident_type as accidentType,
- risk_measures as riskMeasures,
- responsible_dept as responsibleDept,
- responsible_person as responsiblePerson,
- org_id as orgId,
- create_time as createTime,
- modify_time as modifyTime
- from
- risk_management
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteById">
- delete from risk_management where id = #{id,jdbcType=INTEGER}
- </delete>
- </mapper>
|