ah_jjzhgd_service/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/TbAreaMapper.xml

46 lines
2.1 KiB
XML
Raw Normal View History

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"/>
</resultMap>
<insert id="insertData">
insert into tb_area(area_id,area_name,bid_code,remarks,
area_code,create_time, gt_id,del_flag)value (
#{areaId},#{areaName},#{bidCode},#{remarks},#{areaCode},now(),#{gtId},0)
</insert>
<update id="updateData">
update tb_area set area_name=#{areaName},bid_code=#{bidCode},remarks=#{remarks},gt_id=#{gtId}
area_code=#{areaCode},update_time=now()
where area_id=#{areaId}
</update>
<update id="deleteArea">
update tb_area set del_flag=1 where area_id=#{areaId}
</update>
<select id="getAreaList" resultType="com.securitycontrol.entity.background.vo.AreaVo">
select area_id,area_name,pro.bid_code, remarks,area_code,pro.pro_name,
area.create_time,area.update_time, area.gt_id,gt.gt_name
from tb_area area
left join tb_project pro on pro.bid_code=area.bid_code
LEFT JOIN t_pro_gt gt on area.gt_id=gt.gt_id
where area.del_flag=0 and pro.del_flag=0 and gt.del_flag=0
</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>
</mapper>