ride-lease/ridelease-system/src/main/resources/mapper/system/RlOperatingAreaMapper.xml

119 lines
6.8 KiB
XML
Raw Normal View History

<?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.ruoyi.system.mapper.RlOperatingAreaMapper">
<resultMap type="RlOperatingArea" id="RlOperatingAreaResult">
<result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<result property="boundary" column="boundary" />
<result property="boundaryStr" column="boundary_str" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="status" column="status" />
<result property="areaTime" column="area_time" />
<result property="areaOutOutage" column="area_out_outage" />
<result property="areaOutDispatch" column="area_out_dispatch" />
<result property="agreement" column="agreement" />
<result property="areaTimeStart" column="area_time_start" />
<result property="areaTimeEnd" column="area_time_end" />
</resultMap>
<sql id="selectRlOperatingAreaVo">
select area_id, area_name, boundary, boundary_str, longitude, latitude, create_by, create_time, status, area_time, area_out_outage, area_out_dispatch, agreement, area_time_start, area_time_end from rl_operating_area
</sql>
<select id="selectRlOperatingAreaList" parameterType="RlOperatingArea" resultMap="RlOperatingAreaResult">
<include refid="selectRlOperatingAreaVo"/>
<where>
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
<if test="boundary != null and boundary != ''"> and boundary = #{boundary}</if>
<if test="boundaryStr != null and boundaryStr != ''"> and boundary_str = #{boundaryStr}</if>
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="areaTime != null and areaTime != ''"> and area_time = #{areaTime}</if>
<if test="areaOutOutage != null and areaOutOutage != ''"> and area_out_outage = #{areaOutOutage}</if>
<if test="areaOutDispatch != null and areaOutDispatch != ''"> and area_out_dispatch = #{areaOutDispatch}</if>
<if test="agreement != null and agreement != ''"> and agreement = #{agreement}</if>
<if test="areaTimeStart != null and areaTimeStart != ''"> and area_time_start = #{areaTimeStart}</if>
<if test="areaTimeEnd != null and areaTimeEnd != ''"> and area_time_end = #{areaTimeEnd}</if>
</where>
</select>
<select id="selectRlOperatingAreaByAreaId" parameterType="Long" resultMap="RlOperatingAreaResult">
<include refid="selectRlOperatingAreaVo"/>
where area_id = #{areaId}
</select>
<insert id="insertRlOperatingArea" parameterType="RlOperatingArea" useGeneratedKeys="true" keyProperty="areaId">
insert into rl_operating_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaName != null">area_name,</if>
<if test="boundary != null">boundary,</if>
<if test="boundaryStr != null">boundary_str,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="status != null">status,</if>
<if test="areaTime != null">area_time,</if>
<if test="areaOutOutage != null">area_out_outage,</if>
<if test="areaOutDispatch != null">area_out_dispatch,</if>
<if test="agreement != null">agreement,</if>
<if test="areaTimeStart != null">area_time_start,</if>
<if test="areaTimeEnd != null">area_time_end,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaName != null">#{areaName},</if>
<if test="boundary != null">#{boundary},</if>
<if test="boundaryStr != null">#{boundaryStr},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="status != null">#{status},</if>
<if test="areaTime != null">#{areaTime},</if>
<if test="areaOutOutage != null">#{areaOutOutage},</if>
<if test="areaOutDispatch != null">#{areaOutDispatch},</if>
<if test="agreement != null">#{agreement},</if>
<if test="areaTimeStart != null">#{areaTimeStart},</if>
<if test="areaTimeEnd != null">#{areaTimeEnd},</if>
</trim>
</insert>
<update id="updateRlOperatingArea" parameterType="RlOperatingArea">
update rl_operating_area
<trim prefix="SET" suffixOverrides=",">
<if test="areaName != null">area_name = #{areaName},</if>
<if test="boundary != null">boundary = #{boundary},</if>
<if test="boundaryStr != null">boundary_str = #{boundaryStr},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="status != null">status = #{status},</if>
<if test="areaTime != null">area_time = #{areaTime},</if>
<if test="areaOutOutage != null">area_out_outage = #{areaOutOutage},</if>
<if test="areaOutDispatch != null">area_out_dispatch = #{areaOutDispatch},</if>
<if test="agreement != null">agreement = #{agreement},</if>
<if test="areaTimeStart != null">area_time_start = #{areaTimeStart},</if>
<if test="areaTimeEnd != null">area_time_end = #{areaTimeEnd},</if>
</trim>
where area_id = #{areaId}
</update>
<delete id="deleteRlOperatingAreaByAreaId" parameterType="Long">
delete from rl_operating_area where area_id = #{areaId}
</delete>
<delete id="deleteRlOperatingAreaByAreaIds" parameterType="String">
delete from rl_operating_area where area_id in
<foreach item="areaId" collection="array" open="(" separator="," close=")">
#{areaId}
</foreach>
</delete>
</mapper>