91 lines
3.7 KiB
XML
91 lines
3.7 KiB
XML
<?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.god.base.server.mapper.CarMapper">
|
|
|
|
<!-- 车辆列表-->
|
|
<!-- <select id="getList" resultType="com.god.base.server.common.domain.Car">-->
|
|
<!-- SELECT-->
|
|
<!-- t_car.car_vin_id as vin ,-->
|
|
<!-- t_car.car_type_id as 车辆类型 ,-->
|
|
<!-- t_car.fence_id as 电子围栏ID ,-->
|
|
<!-- t_car.battery_manufacturer as 电池厂商 ,-->
|
|
<!-- t_car.motor_manufacturer as 电机厂商 ,-->
|
|
<!-- t_car.motor_number as 电机编号 ,-->
|
|
<!-- t_car.battery_number as 电池编号 ,-->
|
|
<!-- t_car.status as 车辆状态-->
|
|
|
|
<!-- FROM-->
|
|
<!-- t_car-->
|
|
<!-- JOIN t_fence ON t_car.fence_id = t_fence.fence_id-->
|
|
<!-- JOIN t_car_type ON t_car.car_type_id = t_car_type.id-->
|
|
<!-- where t_car.user_id = #{userId1}-->
|
|
<!-- </select>-->
|
|
|
|
|
|
<sql id="selectVehicleInfoVo">
|
|
select car_vin_id, car_type_id, fence_id, battery_manufacturer, motor_manufacturer, motor_numberr, battery_number,status from t_car
|
|
</sql>
|
|
<!--车辆列表查询-->
|
|
<select id="selectVehicleInfoList" resultType="com.god.base.domain.Car">
|
|
<include refid="selectVehicleInfoVo"/>
|
|
<where>
|
|
<if test="carVinId != null and carVinId != ''"> and car_vin_id = #{carVinId}</if>"
|
|
<if test="carTypeId != null"> and car_type_id = #{carTypeId}</if>"
|
|
<if test="fenceId != null and fenceId != ''"> and fence_id = #{fenceId}</if>"
|
|
<if test="status != null"> and status = #{status}</if>"
|
|
<if test="motorManufacturer != null and motorManufacturer != ''"> and motor_manufacturer = #{motorManufacturer}</if>"
|
|
<if test="batteryManufacturer != null and batteryManufacturer != ''"> and battery_manufacturer = #{batteryManufacturer}</if>"
|
|
<if test="motorNumber != null and motorNumber != ''"> and motor_number = #{motorNumber}</if>"
|
|
<if test="batteryNumber != null and batteryNumber != ''"> and battery_number = #{batteryNumber}</if>"
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<select id="getOnlineCarIds" resultType="java.lang.String">
|
|
select vin
|
|
from car where vehicle_status = 1
|
|
</select>
|
|
|
|
|
|
<select id="getOnlineCarCount" resultType="java.lang.Integer">
|
|
select count(*)
|
|
from t_car where status = 1
|
|
</select>
|
|
<select id="getUnOnlineCount" resultType="java.lang.Integer">
|
|
select count(*)
|
|
from t_car
|
|
</select>
|
|
<!-- 根据vin查询当前对象的所有信息-->
|
|
<select id="HuiCarSelect" resultType="com.god.base.domain.Car">
|
|
<include refid="selectVehicleInfoVo"/>
|
|
where car_vin_id = #{vinId}
|
|
</select>
|
|
<!-- 根据电子围栏 获取电子围栏信息-->
|
|
<select id="fenceId" resultType="com.god.base.domain.Fence">
|
|
SELECT * from t_fence
|
|
</select>
|
|
<!-- 根据车辆类型 获取车辆类型下拉框-->
|
|
<select id="carTypeId" resultType="com.god.base.domain.CarType">
|
|
select * from t_car_type
|
|
</select>
|
|
<select id="getList" resultType="com.god.base.domain.Car">
|
|
SELECt
|
|
t_car.car_vin_id ,
|
|
t_car_type.car_type_name ,
|
|
t_car.battery_manufacturer ,
|
|
t_car.motor_manufacturer ,
|
|
t_car.motor_number ,
|
|
t_car.battery_number ,
|
|
t_car.status
|
|
FROM
|
|
t_car
|
|
JOIN t_car_type ON t_car.car_type_id = t_car_type.id
|
|
<where>
|
|
<if test="userId != null">
|
|
and t_car.user_id = #{userId}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
</mapper>
|