济菏高速数据中心代码
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.

90 lines
4.2 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.DcEventServiceAreaMapper">
<resultMap type="com.zc.business.domain.DcEventServiceArea" id="DcEventServiceAreaResult">
<result property="id" column="id" />
<result property="exitsInlets" column="exits_inlets" />
<result property="facilityId" column="facility_id" />
<result property="disableFacility" column="disable_facility" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
<result property="dcFacility.direction" column="direction" />
<result property="dcFacility.stakeMarkId" column="stake_mark" />
<result property="dcFacility.remark" column="remark" />
<result property="dcFacility.otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcEventServiceAreaVo">
select id, exits_inlets, facility_id, disable_facility from dc_event_service_area
</sql>
<sql id="selectDcEventServiceAreaVoById">
SELECT
dc_event_service_area.disable_facility AS disable_facility,
dc_event_service_area.exits_inlets as exits_inlets,
dc_event_service_area.facility_id as facility_id,
dc_event_service_area.id as id,
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_service_area </sql>
<select id="selectDcEventServiceAreaList" parameterType="DcEventServiceArea" resultMap="DcEventServiceAreaResult">
<include refid="selectDcEventServiceAreaVo"/>
<where>
<if test="exitsInlets != null "> and exits_inlets = #{exitsInlets}</if>
<if test="facilityId != null "> and facility_id = #{facilityId}</if>
<if test="disableFacility != null "> and disable_facility = #{disableFacility}</if>
</where>
</select>
<select id="selectDcEventServiceAreaById" parameterType="String" resultMap="DcEventServiceAreaResult">
<include refid="selectDcEventServiceAreaVoById"/>
LEFT JOIN dc_facility ON dc_event_service_area.facility_id = dc_facility.id
where dc_event_service_area.id = #{id}
</select>
<insert id="insertDcEventServiceArea" parameterType="DcEventServiceArea">
insert into dc_event_service_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="exitsInlets != null">exits_inlets,</if>
<if test="facilityId != null">facility_id,</if>
<if test="disableFacility != null">disable_facility,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="exitsInlets != null">#{exitsInlets},</if>
<if test="facilityId != null">#{facilityId},</if>
<if test="disableFacility != null">#{disableFacility},</if>
</trim>
</insert>
<update id="updateDcEventServiceArea" parameterType="DcEventServiceArea">
update dc_event_service_area
<trim prefix="SET" suffixOverrides=",">
<if test="exitsInlets != null">exits_inlets = #{exitsInlets},</if>
<if test="facilityId != null">facility_id = #{facilityId},</if>
<if test="disableFacility != null">disable_facility = #{disableFacility},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcEventServiceAreaById" parameterType="String">
delete from dc_event_service_area where id = #{id}
</delete>
<delete id="deleteDcEventServiceAreaByIds" parameterType="String">
delete from dc_event_service_area where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>