106 lines
3.6 KiB
XML
106 lines
3.6 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.zcloud.mapper.datasource.gatemachine.GateAreaMapper">
|
|
<sql id="table"> mk_gate_area </sql>
|
|
|
|
<sql id="filed">
|
|
f.GATE_AREA_ID,
|
|
f.GATE_AREA_NAME,
|
|
f.GATE_AREA_TYPE,
|
|
f.LATITUDE,
|
|
f.LONGITUDE,
|
|
f.CORPINFO_ID,
|
|
f.ISDELETE,
|
|
f.CREATOR,
|
|
f.CREATTIME,
|
|
f.OPERATOR,
|
|
f.OPERATTIME
|
|
</sql>
|
|
<insert id="save">
|
|
INSERT INTO <include refid="table"></include>
|
|
(
|
|
GATE_AREA_ID,
|
|
GATE_AREA_NAME,
|
|
GATE_AREA_TYPE,
|
|
LATITUDE,
|
|
LONGITUDE,
|
|
CORPINFO_ID,
|
|
ISDELETE,
|
|
CREATOR,
|
|
CREATTIME,
|
|
OPERATOR,
|
|
OPERATTIME
|
|
)
|
|
VALUES (
|
|
#{GATE_AREA_ID},
|
|
#{GATE_AREA_NAME},
|
|
#{GATE_AREA_TYPE},
|
|
#{LATITUDE},
|
|
#{LONGITUDE},
|
|
#{CORPINFO_ID},
|
|
#{ISDELETE},
|
|
#{CREATOR},
|
|
#{CREATTIME},
|
|
#{OPERATOR},
|
|
#{OPERATTIME}
|
|
)
|
|
</insert>
|
|
<select id="getDatalistPage" resultType="com.zcloud.entity.PageData">
|
|
select <include refid="filed"></include>, CONCAT_WS('--', f.LATITUDE,f.LONGITUDE) LONGTITUDEANDLATITUDE,
|
|
(select count(1) from BUS_GATEVIDEO v where v.GATE_AREA_ID = f.GATE_AREA_ID and v.ISDELETE = '0') as VIDEO_COUNT,
|
|
(select count(1) from mk_gate_machine m where m.GATE_AREA_ID = f.GATE_AREA_ID and m.ISDELETE = '0') as GATE_COUNT
|
|
from
|
|
<include refid="table"></include> f where f.ISDELETE = 0
|
|
<if test="pd.GATE_AREA_NAME != null and pd.GATE_AREA_NAME != ''">
|
|
and f.GATE_AREA_NAME like CONCAT(CONCAT('%', #{pd.GATE_AREA_NAME}),'%')
|
|
</if>
|
|
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
|
|
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
|
</if>
|
|
<if test="pd.GATE_AREA_TYPE != null and pd.GATE_AREA_TYPE != ''">
|
|
and f.GATE_AREA_TYPE = #{pd.GATE_AREA_TYPE}
|
|
</if>
|
|
order by f.OPERATTIME desc
|
|
</select>
|
|
<select id="getGatePosition" resultType="com.zcloud.entity.PageData">
|
|
select LONGITUDE,
|
|
LATITUDE,
|
|
GATE_AREA_NAME,
|
|
GATE_AREA_NAME as MAP_POINT_NAME,
|
|
'${TYPE}' TYPE,
|
|
GATE_AREA_ID id
|
|
FROM
|
|
mk_gate_area
|
|
WHERE
|
|
isdelete = 0 and GATE_AREA_TYPE = #{GATE_AREA_TYPE}
|
|
<if test="AREA != null and AREA != ''">
|
|
and CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0)
|
|
</if>
|
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
|
and CORPINFO_ID = #{CORPINFO_ID}
|
|
</if>
|
|
</select>
|
|
<update id="edit">
|
|
update
|
|
<include refid="table"></include>
|
|
set
|
|
GATE_AREA_NAME = #{GATE_AREA_NAME},
|
|
GATE_AREA_TYPE = #{GATE_AREA_TYPE},
|
|
LONGITUDE = #{LONGITUDE},
|
|
LATITUDE = #{LATITUDE},
|
|
CORPINFO_ID = #{CORPINFO_ID},
|
|
OPERATOR = #{OPERATOR},
|
|
OPERATTIME = #{OPERATTIME}
|
|
where
|
|
GATE_AREA_ID = #{GATE_AREA_ID}
|
|
</update>
|
|
<update id="removeByIds">
|
|
update mk_gate_area
|
|
set ISDELETE = 1
|
|
where GATE_AREA_ID in
|
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|