|
|
|
<?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.DcEventTrafficControlMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.zc.business.domain.DcEventTrafficControl" id="DcEventTrafficControlResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="controlType" column="control_type" />
|
|
|
|
<result property="controlCause" column="control_cause" />
|
|
|
|
<result property="exitsInlets" column="exits_inlets" />
|
|
|
|
<result property="facilityId" column="facility_id" />
|
|
|
|
<result property="rampId" column="ramp_id" />
|
|
|
|
<result property="causeType" column="cause_type" />
|
|
|
|
|
|
|
|
<result property="measure" column="measure" />
|
|
|
|
<result property="classify" column="classify" />
|
|
|
|
<result property="limitedType" column="limited_type" />
|
|
|
|
<result property="vehicleType" column="vehicle_type" />
|
|
|
|
<result property="dcFacility.facilityName" column="facility_name" />
|
|
|
|
<result property="dcFacility.facilityType" column="facility_type" />
|
|
|
|
<result property="dcFacility.direction" column="direction" />
|
|
|
|
<result property="dcFacility.stakeMark" column="stake_mark" />
|
|
|
|
<result property="dcFacility.remark" column="remark" />
|
|
|
|
<result property="dcFacility.otherConfig" column="other_config" />
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectDcEventTrafficControlVo">
|
|
|
|
select id, control_type, control_cause, exits_inlets, facility_id, ramp_id,cause_type,measure,classify,limited_type,vehicle_type from dc_event_traffic_control
|
|
|
|
</sql>
|
|
|
|
<!--关联路网设施查询-->
|
|
|
|
<sql id="selectDcEventTrafficControlVoById">
|
|
|
|
SELECT dc_event_traffic_control.control_cause AS control_cause,
|
|
|
|
dc_event_traffic_control.control_type as control_type,
|
|
|
|
dc_event_traffic_control.exits_inlets as exits_inlets,
|
|
|
|
dc_event_traffic_control.facility_id as facility_id,
|
|
|
|
dc_event_traffic_control.id as id,
|
|
|
|
dc_event_traffic_control.classify as classify,
|
|
|
|
dc_event_traffic_control.ramp_id as ramp_id,
|
|
|
|
dc_event_traffic_control.limited_type as limited_type,
|
|
|
|
dc_event_traffic_control.vehicle_type as vehicle_type,
|
|
|
|
dc_event_traffic_control.measure as measure,
|
|
|
|
dc_event_traffic_control.cause_type as cause_type,
|
|
|
|
dc_facility.other_config as other_config,
|
|
|
|
dc_facility.remark as remark,
|
|
|
|
dc_facility.stake_mark as stake_mark,
|
|
|
|
dc_facility.facility_type as facility_type,
|
|
|
|
dc_facility.facility_name as facility_name,
|
|
|
|
dc_facility.direction as direction
|
|
|
|
FROM dc_event_traffic_control </sql>
|
|
|
|
|
|
|
|
<select id="selectDcEventTrafficControlList" parameterType="DcEventTrafficControl" resultMap="DcEventTrafficControlResult">
|
|
|
|
<include refid="selectDcEventTrafficControlVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="controlType != null "> and control_type = #{controlType}</if>
|
|
|
|
<if test="controlCause != null "> and control_cause = #{controlCause}</if>
|
|
|
|
<if test="exitsInlets != null "> and exits_inlets = #{exitsInlets}</if>
|
|
|
|
<if test="facilityId != null "> and facility_id = #{facilityId}</if>
|
|
|
|
<if test="rampId != null "> and ramp_id = #{rampId}</if>
|
|
|
|
<if test="causeType != null "> and cause_type = #{causeType}</if>
|
|
|
|
|
|
|
|
<if test="measure != null "> and measure = #{measure}</if>
|
|
|
|
<if test="classify != null "> and classify = #{classify}</if>
|
|
|
|
<if test="limitedType != null "> and limited_type = #{limitedType}</if>
|
|
|
|
<if test="vehicleType != null "> and vehicle_type = #{vehicleType}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectDcEventTrafficControlById" parameterType="String" resultMap="DcEventTrafficControlResult">
|
|
|
|
<include refid="selectDcEventTrafficControlVoById"/>
|
|
|
|
LEFT JOIN dc_facility ON dc_event_traffic_control.facility_id = dc_facility.id
|
|
|
|
where dc_event_traffic_control.id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertDcEventTrafficControl" parameterType="DcEventTrafficControl">
|
|
|
|
insert into dc_event_traffic_control
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
<if test="controlType != null">control_type,</if>
|
|
|
|
<if test="controlCause != null">control_cause,</if>
|
|
|
|
<if test="exitsInlets != null">exits_inlets,</if>
|
|
|
|
<if test="facilityId != null">facility_id,</if>
|
|
|
|
<if test="rampId != null">ramp_id,</if>
|
|
|
|
cause_type,
|
|
|
|
|
|
|
|
<if test="measure != null">measure,</if>
|
|
|
|
<if test="classify != null">classify,</if>
|
|
|
|
<if test="vehicleType != null">vehicle_type,</if>
|
|
|
|
<if test="limitedType != null">limited_type,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
<if test="controlType != null">#{controlType},</if>
|
|
|
|
<if test="controlCause != null">#{controlCause},</if>
|
|
|
|
<if test="exitsInlets != null">#{exitsInlets},</if>
|
|
|
|
<if test="facilityId != null">#{facilityId},</if>
|
|
|
|
<if test="rampId != null">#{rampId},</if>
|
|
|
|
#{causeType},
|
|
|
|
|
|
|
|
<if test="measure != null">#{measure},</if>
|
|
|
|
<if test="classify != null">#{classify},</if>
|
|
|
|
<if test="vehicleType != null">#{vehicleType},</if>
|
|
|
|
<if test="limitedType != null">#{limitedType},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateDcEventTrafficControl" parameterType="DcEventTrafficControl">
|
|
|
|
update dc_event_traffic_control
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="controlType != null">control_type = #{controlType},</if>
|
|
|
|
<if test="controlCause != null">control_cause = #{controlCause},</if>
|
|
|
|
<if test="exitsInlets != null">exits_inlets = #{exitsInlets},</if>
|
|
|
|
<if test="facilityId != null">facility_id = #{facilityId},</if>
|
|
|
|
<if test="rampId != null">ramp_id = #{rampId},</if>
|
|
|
|
cause_type = #{causeType},
|
|
|
|
<if test="measure != null">measure = #{measure},</if>
|
|
|
|
<if test="classify != null">classify = #{classify},</if>
|
|
|
|
<if test="vehicleType != null">vehicle_type = #{vehicleType},</if>
|
|
|
|
<if test="limitedType != null">limited_type = #{limitedType},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteDcEventTrafficControlById" parameterType="String">
|
|
|
|
delete from dc_event_traffic_control where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteDcEventTrafficControlByIds" parameterType="String">
|
|
|
|
delete from dc_event_traffic_control where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|