2024-03-26 17:25:06 +08:00
|
|
|
<?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.securitycontrol.background.mapper.TbAreaMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="AreaMap" type="com.securitycontrol.entity.background.vo.AreaVo">
|
|
|
|
|
<id property="areaId" column="area_id"/>
|
|
|
|
|
<result property="areaName" column="area_name"/>
|
|
|
|
|
<result property="bidCode" column="bid_code"/>
|
|
|
|
|
<result property="remarks" column="remarks"/>
|
|
|
|
|
<result property="areaCode" column="area_code"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="gtId" column="gt_id"/>
|
|
|
|
|
<result property="gtName" column="gt_name"/>
|
|
|
|
|
<result property="proName" column="pro_name"/>
|
2024-03-27 17:35:22 +08:00
|
|
|
<result property="areaType" column="area_type"/>
|
2024-03-26 17:25:06 +08:00
|
|
|
</resultMap>
|
|
|
|
|
<insert id="insertData">
|
|
|
|
|
insert into tb_area(area_id,area_name,bid_code,remarks,
|
2024-03-27 17:35:22 +08:00
|
|
|
area_code,create_time, gt_id,del_flag,area_type)value (
|
|
|
|
|
#{areaId},#{areaName},#{bidCode},#{remarks},#{areaCode},now(),#{gtId},0,#{areaType})
|
2024-03-26 17:25:06 +08:00
|
|
|
</insert>
|
|
|
|
|
<update id="updateData">
|
2024-03-26 18:35:43 +08:00
|
|
|
update tb_area set area_name=#{areaName},bid_code=#{bidCode},remarks=#{remarks},gt_id=#{gtId},
|
2024-03-27 17:35:22 +08:00
|
|
|
area_code=#{areaCode},update_time=now(),area_type=#{areaType}
|
2024-03-26 17:25:06 +08:00
|
|
|
where area_id=#{areaId}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="deleteArea">
|
|
|
|
|
update tb_area set del_flag=1 where area_id=#{areaId}
|
|
|
|
|
</update>
|
|
|
|
|
|
2024-03-27 17:35:22 +08:00
|
|
|
<select id="getAreaList" resultMap="AreaMap">
|
2024-03-26 17:25:06 +08:00
|
|
|
select area_id,area_name,pro.bid_code, remarks,area_code,pro.pro_name,
|
2024-03-27 17:35:22 +08:00
|
|
|
area.create_time,area.update_time, area.gt_id,gt.gt_name,area.area_type
|
2024-03-26 17:25:06 +08:00
|
|
|
from tb_area area
|
2024-03-26 18:35:43 +08:00
|
|
|
left join tb_project pro on pro.bid_code=area.bid_code and pro.del_flag=0
|
|
|
|
|
LEFT JOIN t_pro_gt gt on area.gt_id=gt.gt_id and gt.del_flag=0
|
|
|
|
|
where area.del_flag=0
|
2024-03-27 17:35:22 +08:00
|
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
|
|
|
AND INSTR(area_name,#{keyWord}) > 0
|
|
|
|
|
</if>
|
2024-03-26 17:25:06 +08:00
|
|
|
</select>
|
|
|
|
|
<select id="getProjectTypeByBidCode" resultType="java.lang.String">
|
|
|
|
|
select pro_type
|
|
|
|
|
from tb_project pro
|
|
|
|
|
where pro.del_flag=0 AND pro.bid_code=#{bidCode}
|
|
|
|
|
</select>
|
2024-03-27 17:35:22 +08:00
|
|
|
<select id="getGtList" resultType="com.securitycontrol.entity.background.vo.GtVo">
|
|
|
|
|
select
|
|
|
|
|
gt.gt_id gtId,gt_name gtName, gt_code gtCode,
|
|
|
|
|
bid_code bidCode, lat,lon,
|
|
|
|
|
now_gx nowGx, create_time createTime,update_time updateTime,tgg.gx_name gxName
|
|
|
|
|
from t_pro_gt gt
|
|
|
|
|
left join tb_gt_gx tgg on gt.now_gx=tgg.gx_id
|
|
|
|
|
WHERE gt.del_flag=0 and gt.bid_code=#{bidCode}
|
|
|
|
|
<if test="keyWord!=null and keyWord!=''">
|
|
|
|
|
AND (
|
|
|
|
|
INSTR(gt_name,#{keyWord}) > 0 or
|
|
|
|
|
INSTR(gt_code,#{keyWord}) > 0
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</select>
|
2024-03-26 17:25:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|