|
|
<?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.ykMap.mapper.LineMapper">
|
|
|
<select id="selectLineInfo" resultType="com.ykMap.entity.response.SelectLineInfoResponse">
|
|
|
select name, case when name like '%维护%' then '维护线路' else '押运线路' end as type
|
|
|
from task_mission
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
<select id="equip" resultType="com.ykMap.entity.response.EquipResponse">
|
|
|
select thing_type,
|
|
|
case when thing_type= '车辆' then concat(right(vehicle_info, CHARACTER_LENGTH(vehicle_info)-POSITION('-' in vehicle_info)),' (',left(vehicle_info,POSITION('-' in vehicle_info)-1),')')
|
|
|
when thing_type= '枪支' then concat(thing_info,' (',c3.model,')')
|
|
|
when thing_type= '弹夹' then concat(thing_info) end as type
|
|
|
from task_mission_thing a1
|
|
|
left join thing_gun c3 on a1.thing_id = c3.thing_id
|
|
|
where task_mission_id = #{id}
|
|
|
and a1.is_delete='0'
|
|
|
and a1.thing_type != 'PDA'
|
|
|
and a1.is_change = 0 -- 是否交换 1是 0否(对应任务应急)
|
|
|
</select>
|
|
|
<select id="userInfo" resultType="com.ykMap.entity.response.UserInfoResponse">
|
|
|
select substr(a1.employee_info,7,6) as ename, b2.name, b2.order_num
|
|
|
from task_mission_employee a1
|
|
|
left join task_position b2 on a1.task_position_id = b2.id and b2.is_delete='0' and b2.state='1'
|
|
|
where a1.is_delete='0'
|
|
|
and a1.task_mission_id=#{id}
|
|
|
and a1.is_change = 0 -- 是否交换 1是 0否
|
|
|
order by b2.order_num
|
|
|
</select>
|
|
|
<select id="items" resultType="com.ykMap.entity.response.ItemsResponse">
|
|
|
select count(bank_thing_id) as count
|
|
|
from task_mission_package
|
|
|
where task_mission_id = #{id}
|
|
|
and is_delete =0 and state = '正常'
|
|
|
</select>
|
|
|
<select id="lineTemplate" resultType="com.ykMap.entity.response.LineTemplateResponse">
|
|
|
SELECT area,
|
|
|
SUM(outlets_total_num) AS outlets_total_num,
|
|
|
SUM(payment_point_num) AS payment_point_num,
|
|
|
SUM(line_total_num) AS line_total_num,
|
|
|
SUM(atm_total_num) AS atm_total_num
|
|
|
FROM ysk_ywbmwjdr.operation_overview_data
|
|
|
WHERE data_time >= #{a1}
|
|
|
AND data_time < #{a2}
|
|
|
GROUP BY
|
|
|
area
|
|
|
</select>
|
|
|
|
|
|
<select id="searchCity" resultType="com.ykMap.entity.response.SearchCityResponse">
|
|
|
SELECT
|
|
|
province_name AS city,
|
|
|
data_time
|
|
|
FROM
|
|
|
ysk_ywbmwjdr.operation_expansion_data
|
|
|
WHERE
|
|
|
data_time >= #{a1} and data_time < #{a2}
|
|
|
</select>
|
|
|
<select id="searchCityCount" resultType="com.ykMap.entity.response.SearchCityCountResponse">
|
|
|
SELECT count(*) AS count
|
|
|
FROM ysk_ywbmwjdr.operation_expansion_data
|
|
|
WHERE data_time >= #{a1}
|
|
|
and data_time < #{a2}
|
|
|
</select>
|
|
|
<select id="getByCarId" resultType="java.lang.String">
|
|
|
select task_mission_id
|
|
|
from task_mission_thing where vehicle_id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="findLineTemplateTime" resultType="java.time.LocalDateTime">
|
|
|
select data_time
|
|
|
from ysk_ywbmwjdr.operation_overview_data
|
|
|
order by data_time desc
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
<select id="findCityTime" resultType="java.time.LocalDateTime">
|
|
|
SELECT
|
|
|
data_time
|
|
|
FROM
|
|
|
ysk_ywbmwjdr.operation_expansion_data
|
|
|
order by data_time desc
|
|
|
limit 1
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|