Commit e0d40437 authored by zhangsen's avatar zhangsen

车辆接口sql修改

parent ad452a20
...@@ -2488,38 +2488,41 @@ ...@@ -2488,38 +2488,41 @@
</select> </select>
<select id="getFireCarInfoByWL" resultType="java.util.Map"> <select id="getFireCarInfoByWL" resultType="java.util.Map">
SELECT select a.* from
`wc`.`id` AS `id`, (SELECT
`wc`.`name` AS `name`, `wc`.`id` AS `id`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ) AS `waterCapacity`, `wc`.`name` AS `name`,
max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ) AS `foamCapacity`, max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ) AS
max( `waterCapacity`,
CASE max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ) AS
`foamCapacity`,
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN max(
'启动' CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
'熄火' WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
END '启动'
) AS `carState`, WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
max( '熄火'
CASE END
) AS `carState`,
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN max(
`wcp`.`update_date` CASE
WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
`wcp`.`update_date` WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'true' ) THEN
END `wcp`.`update_date`
) AS `carStateDate` WHEN ( `wcp`.`equipment_index_key` = 'FireCar_Start' AND `wcp`.`value` = 'false' ) THEN
`wcp`.`update_date`
END
) AS `carStateDate`
FROM FROM
`wl_car` `wc` `wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id` LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
<where> <where>
1=1 1=1
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR} AND wc.biz_org_code = #{bizOrgCode,jdbcType=VARCHAR}
</if> </if>
</where> </where>) a
</select> </select>
<select id="getWaterInfo" resultType="java.util.Map"> <select id="getWaterInfo" resultType="java.util.Map">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment