102 lines
4.9 KiB
XML
102 lines
4.9 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.EtParkingAreaMapper">
|
|
|
|
<resultMap type="EtParkingArea" id="EtParkingAreaResult">
|
|
<result property="parkingId" column="parking_id" />
|
|
<result property="parkingName" column="parking_name" />
|
|
<result property="type" column="type" />
|
|
<result property="areaId" column="area_id" />
|
|
<result property="boundary" column="boundary" />
|
|
<result property="boundaryStr" column="boundary_str" />
|
|
<result property="longitude" column="longitude" />
|
|
<result property="latitude" column="latitude" />
|
|
<result property="picture" column="picture" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEtParkingAreaVo">
|
|
select parking_id, parking_name, type, area_id, AsText(boundary) boundary, boundary_str, longitude, latitude, picture, remark, create_by, create_time from et_parking_area
|
|
</sql>
|
|
|
|
<select id="selectEtParkingAreaList" parameterType="EtParkingArea" resultMap="EtParkingAreaResult">
|
|
<include refid="selectEtParkingAreaVo"/>
|
|
<where>
|
|
<if test="parkingName != null and parkingName != ''"> and parking_name like concat('%', #{parkingName}, '%')</if>
|
|
<if test="areaId != null "> and area_id = #{areaId}</if>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectEtParkingAreaByParkingId" parameterType="Long" resultMap="EtParkingAreaResult">
|
|
<include refid="selectEtParkingAreaVo"/>
|
|
where parking_id = #{parkingId}
|
|
</select>
|
|
|
|
<select id="checkParkingNameUnique" parameterType="String" resultMap="EtParkingAreaResult">
|
|
select parking_id, parking_name from et_parking_area where parking_name = #{parkingName} limit 1
|
|
</select>
|
|
|
|
<insert id="insertEtParkingArea" parameterType="EtParkingArea">
|
|
insert into et_parking_area
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="parkingId != null">parking_id,</if>
|
|
<if test="parkingName != null">parking_name,</if>
|
|
<if test="type != null">type,</if>
|
|
<if test="areaId != null">area_id,</if>
|
|
<if test="boundary != null">boundary,</if>
|
|
<if test="longitude != null">longitude,</if>
|
|
<if test="latitude != null">latitude,</if>
|
|
<if test="picture != null">picture,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="parkingId != null">#{parkingId},</if>
|
|
<if test="parkingName != null">#{parkingName},</if>
|
|
<if test="type != null">#{type},</if>
|
|
<if test="areaId != null">#{areaId},</if>
|
|
<if test="boundary != null">#{boundary},</if>
|
|
<if test="longitude != null">#{longitude},</if>
|
|
<if test="latitude != null">#{latitude},</if>
|
|
<if test="picture != null">#{picture},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEtParkingArea" parameterType="EtParkingArea">
|
|
update et_parking_area
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="parkingName != null">parking_name = #{parkingName},</if>
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="areaId != null">area_id = #{areaId},</if>
|
|
<if test="boundary != null">boundary = #{boundary},</if>
|
|
<if test="longitude != null">longitude = #{longitude},</if>
|
|
<if test="latitude != null">latitude = #{latitude},</if>
|
|
<if test="picture != null">picture = #{picture},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
</trim>
|
|
where parking_id = #{parkingId}
|
|
</update>
|
|
|
|
<delete id="deleteEtParkingAreaByParkingId" parameterType="Long">
|
|
delete from et_parking_area where parking_id = #{parkingId}
|
|
</delete>
|
|
|
|
<delete id="deleteEtParkingAreaByParkingIds" parameterType="String">
|
|
delete from et_parking_area where parking_id in
|
|
<foreach item="parkingId" collection="array" open="(" separator="," close=")">
|
|
#{parkingId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|