247 lines
5.8 KiB
XML
247 lines
5.8 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.dsno2.map.PlatformelectronicMapper">
|
|
|
|
<!--表名 -->
|
|
<sql id="tableName">
|
|
BUS_PLATFORMELECTRONIC
|
|
</sql>
|
|
|
|
<!--数据字典表名 -->
|
|
<sql id="dicTableName">
|
|
SYS_DICTIONARIES
|
|
</sql>
|
|
|
|
<!-- 字段 -->
|
|
<sql id="Field">
|
|
f.INDEXCODE,
|
|
f.REGIONINDEXCODE,
|
|
f.EXTERNALINDEXCODE,
|
|
f.NAME,
|
|
f.LONGITUDE,
|
|
f.LATITUDE,
|
|
f.CAMERATYPE,
|
|
f.CASCADECODE,
|
|
f.DECODETAG,
|
|
f.RESOURCETYPE,
|
|
f.CREATETIME,
|
|
f.UPDATETIME,
|
|
f.SORT,
|
|
f.DISORDER,
|
|
f.RECORDLOCATION,
|
|
f.CASCADETYPE,
|
|
f.REGIONNAME,
|
|
f.REGIONPATH,
|
|
f.REGIONPATHNAME,
|
|
f.PLATFORMELECTRONIC_ID,
|
|
f.FANGQU_IDS,
|
|
f.SUOSHUQUYU,
|
|
f.CORPINFO_ID
|
|
</sql>
|
|
|
|
<!-- 字段用于新增 -->
|
|
<sql id="Field2">
|
|
INDEXCODE,
|
|
REGIONINDEXCODE,
|
|
EXTERNALINDEXCODE,
|
|
NAME,
|
|
LONGITUDE,
|
|
LATITUDE,
|
|
CAMERATYPE,
|
|
CASCADECODE,
|
|
DECODETAG,
|
|
RESOURCETYPE,
|
|
CREATETIME,
|
|
UPDATETIME,
|
|
SORT,
|
|
DISORDER,
|
|
RECORDLOCATION,
|
|
CASCADETYPE,
|
|
REGIONNAME,
|
|
REGIONPATH,
|
|
REGIONPATHNAME,
|
|
PLATFORMELECTRONIC_ID,
|
|
FANGQU_IDS,
|
|
SUOSHUQUYU,
|
|
CORPINFO_ID
|
|
</sql>
|
|
|
|
<!-- 字段值 -->
|
|
<sql id="FieldValue">
|
|
#{INDEXCODE},
|
|
#{REGIONINDEXCODE},
|
|
#{EXTERNALINDEXCODE},
|
|
#{NAME},
|
|
#{LONGITUDE},
|
|
#{LATITUDE},
|
|
#{CAMERATYPE},
|
|
#{CASCADECODE},
|
|
#{DECODETAG},
|
|
#{RESOURCETYPE},
|
|
#{CREATETIME},
|
|
#{UPDATETIME},
|
|
#{SORT},
|
|
#{DISORDER},
|
|
#{RECORDLOCATION},
|
|
#{CASCADETYPE},
|
|
#{REGIONNAME},
|
|
#{REGIONPATH},
|
|
#{REGIONPATHNAME},
|
|
#{PLATFORMELECTRONIC_ID},
|
|
#{FANGQU_IDS},
|
|
#{SUOSHUQUYU},
|
|
#{CORPINFO_ID}
|
|
</sql>
|
|
|
|
<!-- 新增-->
|
|
<insert id="save" parameterType="pd">
|
|
insert into
|
|
<include refid="tableName"></include>
|
|
(
|
|
<include refid="Field2"></include>
|
|
) values (
|
|
<include refid="FieldValue"></include>
|
|
)
|
|
</insert>
|
|
|
|
<!-- 删除-->
|
|
<delete id="delete" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
ISDELETE = '1'
|
|
where
|
|
PLATFORMELECTRONIC_ID = #{PLATFORMELECTRONIC_ID}
|
|
</delete>
|
|
|
|
<!-- 修改 -->
|
|
<update id="edit" parameterType="pd">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
INDEXCODE = #{INDEXCODE},
|
|
REGIONINDEXCODE = #{REGIONINDEXCODE},
|
|
EXTERNALINDEXCODE = #{EXTERNALINDEXCODE},
|
|
NAME = #{NAME},
|
|
LONGITUDE = #{LONGITUDE},
|
|
LATITUDE = #{LATITUDE},
|
|
CAMERATYPE = #{CAMERATYPE},
|
|
CASCADECODE = #{CASCADECODE},
|
|
DECODETAG = #{DECODETAG},
|
|
RESOURCETYPE = #{RESOURCETYPE},
|
|
CREATETIME = #{CREATETIME},
|
|
UPDATETIME = #{UPDATETIME},
|
|
SORT = #{SORT},
|
|
DISORDER = #{DISORDER},
|
|
RECORDLOCATION = #{RECORDLOCATION},
|
|
CASCADETYPE = #{CASCADETYPE},
|
|
REGIONNAME = #{REGIONNAME},
|
|
REGIONPATH = #{REGIONPATH},
|
|
REGIONPATHNAME = #{REGIONPATHNAME},
|
|
FANGQU_IDS = #{FANGQU_IDS},
|
|
SUOSHUQUYU = #{SUOSHUQUYU},
|
|
CORPINFO_ID = #{CORPINFO_ID}
|
|
where
|
|
PLATFORMELECTRONIC_ID = #{PLATFORMELECTRONIC_ID}
|
|
</update>
|
|
|
|
<!-- 通过ID获取数据 -->
|
|
<select id="findById" parameterType="pd" resultType="pd">
|
|
select
|
|
<include refid="Field"></include>
|
|
from
|
|
<include refid="tableName"></include> f
|
|
where
|
|
f.PLATFORMELECTRONIC_ID = #{PLATFORMELECTRONIC_ID}
|
|
</select>
|
|
|
|
<!-- 列表 -->
|
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
|
select
|
|
<include refid="Field"></include> ,corp.CORP_NAME as corpName,
|
|
(select GROUP_CONCAT(t.NAME) from `qa-gwj-prevention`.sys_dictionaries t where FIND_IN_SET(f.FANGQU_IDS, t.BIANMA)) as fangquNames
|
|
from
|
|
<include refid="tableName"></include> f
|
|
left join `qa-gwj-prevention`.bus_corp_info corp on corp.CORPINFO_ID = f.CORPINFO_ID
|
|
where 1=1
|
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
|
and
|
|
(
|
|
f.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
|
)
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 列表(全部) -->
|
|
<select id="listAll" parameterType="pd" resultType="pd">
|
|
select
|
|
<include refid="Field"></include>,f.PLATFORMELECTRONIC_ID as id
|
|
from
|
|
<include refid="tableName"></include> f
|
|
LEFT JOIN `qa-gwj-prevention`.bus_corp_info o on f.CORPINFO_ID = o.CORPINFO_ID
|
|
where
|
|
f.LATITUDE is not null and f.LONGITUDE is not null
|
|
and o.ISDELETE = 0
|
|
<if test="AREA != null and AREA != ''">
|
|
and o.AREA = #{AREA}
|
|
</if>
|
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
|
</if>
|
|
<if test="forMap != null and forMap != ''">
|
|
-- and f.REGIONINDEXCODE in ('3152c0150e93491fb37f5c015fbb943e','1b0f290142534d62957bf0b6f852c589')
|
|
</if>
|
|
<if test="INDEXCODE !=null and INDEXCODE != ''">
|
|
and f.INDEXCODE = #{INDEXCODE}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 批量删除 -->
|
|
<delete id="deleteAll" parameterType="String">
|
|
update
|
|
<include refid="tableName"></include>
|
|
set
|
|
ISDELETE = '1'
|
|
where
|
|
PLATFORMELECTRONIC_ID in
|
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="countAllForMap" resultType="int">
|
|
select
|
|
count(1)
|
|
from
|
|
<include refid="tableName"></include> f
|
|
LEFT JOIN `qa-gwj-prevention`.bus_corp_info o on f.CORPINFO_ID = o.CORPINFO_ID
|
|
where 1=1
|
|
and f.LATITUDE is not null and f.LONGITUDE is not null
|
|
and o.ISDELETE = 0
|
|
<if test="AREA != null and AREA != ''">
|
|
and o.AREA = #{AREA}
|
|
</if>
|
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="countAllByArea" resultType="pd">
|
|
select
|
|
f.SUOSHUQUYU,count(1) co
|
|
from
|
|
<include refid="tableName"></include> f
|
|
LEFT JOIN `qa-gwj-prevention`.bus_corp_info o on f.CORPINFO_ID = o.CORPINFO_ID
|
|
where 1=1
|
|
and f.LATITUDE is not null and f.LONGITUDE is not null
|
|
and o.ISDELETE = 0
|
|
<if test="AREA != null and AREA != ''">
|
|
and o.AREA = #{AREA}
|
|
</if>
|
|
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
|
</if>
|
|
group by f.SUOSHUQUYU
|
|
</select>
|
|
</mapper>
|