| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?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="platform.modules.carrier.dao.ContractFloorDao">
- <!-- 批量插入-->
- <insert id="insertBatch" parameterType="platform.modules.carrier.entity.ContractFloor">
- INSERT INTO ic_contract_floor (
- id, contract_id, building_id,
- floor, remain_area, area,
- status,
- remark, created_time, created_by,
- updated_by, updated_time, del_flag,
- created_name, updated_name
- )
- VALUES
- <foreach collection="list" item="item" open="" separator="," close="">
- (
- #{item.id}, #{item.contract_id}, #{item.building_id},
- #{item.floor}, #{item.remain_area}, #{item.area},
- #{item.status},
- #{item.remark}, #{item.created_time}, #{item.created_by}
- #{item.updated_by}, #{item.updated_time}, #{item.del_flag},
- #{item.created_name}, #{item.updated_name}
- )
- </foreach>
- </insert>
- <delete id="deleteByContractId">
- DELETE FROM ic_contract_floor WHERE contract_id = #{id}
- </delete>
- <select id="findByContractId" resultType="platform.modules.carrier.entity.ContractFloor">
- SELECT cf.*, f.area AS floor_area FROM ic_contract_floor cf LEFT JOIN y_floor f ON f.id = cf.floor_id WHERE cf.id = #{id}
- </select>
- <select id="findEndContract" resultType="platform.modules.carrier.entity.ContractFloor">
- select * from ic_contract_floor where status = 2 and floor_id is not null and contract_end <![CDATA[<]]> now()
- </select>
- <select id="findStartContract" resultType="platform.modules.carrier.entity.ContractFloor">
- select * from ic_contract_floor where status = 1 and floor_id is not null and contract_start <![CDATA[<]]> now()
- </select>
- <select id="finderminateContract" resultType="platform.modules.carrier.entity.ContractFloor">
- select * from ic_contract_floor where status = 4 and floor_id is not null and terminate_time <![CDATA[<]]> now()
- </select>
- <select id="findCarrierVolume" resultType="java.lang.Integer">
- select count(id) from ic_contract_floor where del_flag = 0
- </select>
- <select id="findEachParkVolume" resultType="platform.modules.carrier.entity.CarrierVolume">
- SELECT
- s.id,
- s.`name` AS streetName,
- COUNT(cf.id) AS volume
- FROM
- ic_contract_floor cf
- LEFT JOIN ic_park p ON p.id = cf.park_id
- LEFT JOIN s_street s ON s.id = p.street_id
- WHERE
- cf.del_flag = 0
- GROUP BY
- s.id
- </select>
- <select id="findEndContractByTime" resultType="platform.modules.carrier.entity.CarrierVolume">
- SELECT cf.id FROM ic_contract_floor cf
- WHERE cf.building_id = #{id} AND cf.del_flag = 0
- <if test="startTime != null and startTime != ''">
- AND cf.contract_end > #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND cf.contract_end <![CDATA[<]]> #{endTime}
- </if>
- </select>
- <select id="export1" resultType="platform.modules.carrier.dto.CarrierStatisitcDto">
- SELECT
- s.`name` street,
- p.`name` park,
- b.build_name building,
- b.area area,
- b.rent_area rentArea,
- ( b.area - b.rent_area ) remainingArea,
- c.company_name company,
- c.contract_start contractStart,
- c.contract_end contractEnd
- FROM
- ic_building b
- LEFT JOIN ic_park p ON p.id = b.park_id
- LEFT JOIN s_street s ON s.id = p.street_id
- LEFT JOIN ic_contract c ON c.park_id = p.id
- AND c.del_flag = 0
- WHERE
- b.is_use = 1
- AND b.del_flag = 0
- </select>
- </mapper>
|