123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <?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.bofeng.dao.SweepCodeMapper">
- <select id="selectCode" resultType="com.bofeng.entity.SysUptownHouse">
- select DISTINCT
- a.uptown_name,
- d.ridgepole,
- d.unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- <if test="queryProperties != null and queryProperties != ''">
- b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="uptownId != null and uptownId != ''">
- and a.uptown_id = #{uptownId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- <select id="selectLingyunUser" resultType="com.bofeng.entity.SysUptownHouse">
- select
- b.user_id,
- a.linkman,
- a.phone,
- c.doorplate,
- e.uptown_name,
- concat(d.ridgepole,d.unit) as dept
- from sys_uptown_home a
- inner join sys_user_role b on a.house_id = b.property_id and b.role_id =1
- inner join sys_uptown_house c on c.house_id = b.property_id
- inner join sys_uptown_unit d on c.unit_id = d.unit_id
- inner join sys_uptown e on e.uptown_id = d.uptown_id
- <where>
- <if test="queryProperties != null and queryProperties != ''">
- (a.linkman like concat('%',#{queryProperties},'%')
- or a.phone like concat('%',#{queryProperties},'%'))
- </if>
- <if test="uptownId != null and uptownId != ''">
- and e.uptown_id = #{uptownId}
- </if>
- <if test="unitId != null and unitId != ''">
- and d.unit_id = #{unitId}
- </if>
- </where>
- </select>
- <select id="export" resultType="com.bofeng.entity.SysUptownHouse">
- select DISTINCT
- a.uptown_name,
- d.ridgepole,
- d.unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- <if test="queryProperties != null and queryProperties != ''">
- b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="uptownId != null and uptownId != ''">
- and a.uptown_id = #{uptownId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- <select id="selectCodeLY" resultType="com.bofeng.entity.SysUptownHouseLY">
- select DISTINCT
- a.uptown_name,
- CONCAT(d.ridgepole,d.unit) as unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- a.uptown_id = 1238790987234
- <if test="queryProperties != null and queryProperties != ''">
- and b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="unitId != null and unitId != ''">
- and d.unit_id = #{unitId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- <select id="exportLY" resultType="com.bofeng.entity.SysUptownHouseLY">
- select DISTINCT
- a.uptown_name,
- CONCAT(d.ridgepole,d.unit) as unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- a.uptown_id = 1238790987234
- <if test="queryProperties != null and queryProperties != ''">
- and b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="unitId != null and unitId != ''">
- and d.unit_id = #{unitId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- <select id="selectCodeHC" resultType="com.bofeng.entity.SysUptownHouseLY">
- select DISTINCT
- a.uptown_name,
- CONCAT(d.ridgepole,d.unit) as unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- a.uptown_id = 100000002
- <if test="queryProperties != null and queryProperties != ''">
- and b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="unitId != null and unitId != ''">
- and d.unit_id = #{unitId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- <select id="exportHC" resultType="com.bofeng.entity.SysUptownHouseLY">
- select DISTINCT
- a.uptown_name,
- CONCAT(d.ridgepole,d.unit) as unit,
- e.doorplate,
- b.door_name,
- DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
- c.in_type,
- c.go_status as goStatus,
- c.error_info as errorInfo,
- c.longitude,
- c.latitude,
- g.linkman,
- g.phone,
- c.time_update
- from out_scan c
- inner join sys_user_role t on c.user_id = t.user_id and role_id =1
- inner join sys_uptown_home g on g.house_id = t.property_id
- inner join sys_uptown a on c.uptown_id = a.uptown_id
- inner join sys_uptown_door b on c.door_id = b.door_id
- inner join sys_uptown_house e on e.house_id = t.property_id
- inner join sys_uptown_unit d on d.unit_id = e.unit_id
- <where>
- a.uptown_id = 100000002
- <if test="queryProperties != null and queryProperties != ''">
- and b.door_name like concat('%',#{queryProperties},'%')
- </if>
- <if test="phone != null and phone != ''">
- and (g.linkman like concat('%',#{phone},'%')
- or g.phone = #{phone} )
- </if>
- <if test="unitId != null and unitId != ''">
- and d.unit_id = #{unitId}
- </if>
- <if test="goStatus != null and goStatus !=''">
- and c.go_status = #{goStatus}
- </if>
- <if test="dateSta != null and dateSta !=''">
- and c.date >= #{dateSta}
- </if>
- <if test="dateEnd != null and dateEnd !=''">
- and c.date < #{dateEnd}
- </if>
- </where>
- order by c.time_update desc
- </select>
- </mapper>
|