112 lines
6.0 KiB
XML
112 lines
6.0 KiB
XML
<?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.EOperatingAreaMapper">
|
|
|
|
<resultMap type="EOperatingAreaVO" id="RlOperatingAreaResult" autoMapping="true" />
|
|
|
|
<sql id="selectRlOperatingAreaVo">
|
|
select oa.area_id, oa.area_name, oa.boundary_str, oa.longitude, oa.latitude, oa.create_by, oa.create_time, oa.status, oa.area_time, oa.area_out_outage,
|
|
oa.area_out_dispatch, oa.agreement, oa.area_time_start, oa.area_time_end, oa.e_user_id from e_operating_area oa
|
|
left join e_user m on m.user_id = oa.merchant_id
|
|
</sql>
|
|
|
|
<select id="selectRlOperatingAreaList" parameterType="EOperatingArea" resultMap="RlOperatingAreaResult">
|
|
<include refid="selectRlOperatingAreaVo"/>
|
|
where 1=1
|
|
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</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>
|
|
${params.dataScope}
|
|
order by oa.create_time desc
|
|
</select>
|
|
|
|
<select id="selectRlOperatingAreaByAreaId" parameterType="Long" resultMap="RlOperatingAreaResult">
|
|
<include refid="selectRlOperatingAreaVo"/>
|
|
where oa.area_id = #{areaId}
|
|
</select>
|
|
|
|
<select id="selectRlOperatingAreaByAgentId" parameterType="Long" resultMap="RlOperatingAreaResult">
|
|
<include refid="selectRlOperatingAreaVo"/>
|
|
where oa.agent_id = #{agentId}
|
|
</select>
|
|
|
|
<select id="selectAreaIdByAgentId" resultType="java.lang.Long">
|
|
select area_id from e_operating_area where agent_id = #{agentId}
|
|
</select>
|
|
|
|
<insert id="insertRlOperatingArea" parameterType="EOperatingArea" useGeneratedKeys="true" keyProperty="areaId">
|
|
insert into e_operating_area
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="areaName != null">area_name,</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="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="EOperatingArea">
|
|
update e_operating_area
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="areaName != null">area_name = #{areaName},</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 e_operating_area where area_id = #{areaId}
|
|
</delete>
|
|
|
|
<delete id="deleteRlOperatingAreaByAreaIds" parameterType="String">
|
|
delete from e_operating_area where area_id in
|
|
<foreach item="areaId" collection="array" open="(" separator="," close=")">
|
|
#{areaId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|