You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.9 KiB
61 lines
2.9 KiB
<?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.zc.business.mapper.EventPlanAssocMapper">
|
|
|
|
<insert id="insertEventPlanAssoc" parameterType="EventPlanAssoc">
|
|
insert into event_plan_assoc
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">id,</if>
|
|
<if test="eventId != null and eventId != ''">event_id,</if>
|
|
<if test="emergencyPlansId != null">emergency_plans_id,</if>
|
|
<if test="controlDevice != null and controlDevice != ''">control_device,</if>
|
|
<if test="operationType != null">operation_type,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="controlResult != null and controlResult !=''">control_result,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">#{id},</if>
|
|
<if test="eventId != null and eventId != ''">#{eventId},</if>
|
|
<if test="emergencyPlansId != null">#{emergencyPlansId},</if>
|
|
<if test="controlDevice != null and controlDevice != ''">#{controlDevice},</if>
|
|
<if test="operationType != null">#{operationType},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="controlResult != null and controlResult !=''">#{controlResult},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<sql id="selectEventPlanAssocVo">
|
|
select id,event_id,emergency_plans_id,control_device,create_time,update_time,
|
|
control_result,operation_type
|
|
from event_plan_assoc
|
|
</sql>
|
|
|
|
<select id="selectByEventId" parameterType="EventPlanAssoc" resultType="EventPlanAssoc">
|
|
<include refid="selectEventPlanAssocVo"/>
|
|
where event_id = #{eventId} and operation_type = #{operationType}
|
|
</select>
|
|
|
|
<update id="updateEventPlanAssoc" parameterType="EventPlanAssoc">
|
|
update event_plan_assoc
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="eventId != null and eventId != ''">event_id = #{eventId},</if>
|
|
<if test="emergencyPlansId != null">emergency_plans_id = #{emergencyPlansId},</if>
|
|
<if test="controlDevice != null and controlDevice != ''">
|
|
control_device = #{controlDevice},
|
|
</if>
|
|
<if test="operationType != null">
|
|
operation_type = #{operationType},
|
|
</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="controlResult != null and controlResult !=''">
|
|
control_result = #{controlResult},
|
|
</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
</mapper>
|
|
|