|
@@ -36,7 +36,42 @@
|
|
|
</selectKey>
|
|
|
-->
|
|
|
<![CDATA[
|
|
|
+ <resultMap id="VehicleInfoMap" type="com.jpsoft.bus.modules.bus.entity.VehicleInfo">
|
|
|
+ <id property="id" column="id_"/>
|
|
|
+ <result property="routeId" column="route_id"/>
|
|
|
+ <result property="licensePlateNumber" column="license_plate_number"/>
|
|
|
+ <result property="activationCode" column="activation_code"/>
|
|
|
+ <result property="gpsDeviceNo" column="gps_device_no"/>
|
|
|
+ <result property="deviceNo" column="device_no"/>
|
|
|
+ <result property="picture" column="picture_"/>
|
|
|
+ <result property="loadNumber" column="load_number"/>
|
|
|
+ <result property="longitude" column="longitude_"/>
|
|
|
+ <result property="latitude" column="latitude_"/>
|
|
|
+ <result property="status" column="status_"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="companyId" column="company_id"/>
|
|
|
+ <result property="running" column="running_"/>
|
|
|
+ <result property="acc" column="acc_"/>
|
|
|
+ <result property="online" column="online_"/>
|
|
|
+ <result property="latestAddress" column="latest_address"/>
|
|
|
+ <result property="routeName" column="route_name"/>
|
|
|
+ <result property="trailInterval" column="trail_interval"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.VehicleInfo">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
insert into bus_vehicle_info
|
|
|
+ (id_,route_id,license_plate_number,activation_code,gps_device_no,device_no,picture_,
|
|
|
+ load_number,longitude_,latitude_,status_,create_by,create_time,update_by,
|
|
|
+ update_time,del_flag,company_id,running_,acc_,online_,latest_address,trail_interval)
|
|
|
(id_,route_id,license_plate_number,activation_code,gps_device_no,device_no,picture_,load_number,longitude_,latitude_,status_,create_by,create_time,update_by,update_time,del_flag,company_id,running_,acc_,online_,latest_address,
|
|
|
account_id)
|
|
|
values
|
|
@@ -63,6 +98,28 @@
|
|
|
,#{online,jdbcType= NUMERIC }
|
|
|
,#{latestAddress,jdbcType=VARCHAR}
|
|
|
,#{accountId,jdbcType=VARCHAR}
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{routeId,jdbcType=VARCHAR}
|
|
|
+ ,#{licensePlateNumber,jdbcType=VARCHAR}
|
|
|
+ ,#{activationCode,jdbcType=VARCHAR}
|
|
|
+ ,#{gpsDeviceNo,jdbcType=VARCHAR}
|
|
|
+ ,#{deviceNo,jdbcType=VARCHAR}
|
|
|
+ ,#{picture,jdbcType=VARCHAR}
|
|
|
+ ,#{loadNumber,jdbcType= NUMERIC }
|
|
|
+ ,#{longitude,jdbcType=VARCHAR}
|
|
|
+ ,#{latitude,jdbcType=VARCHAR}
|
|
|
+ ,#{status,jdbcType=VARCHAR}
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ ,#{companyId,jdbcType=VARCHAR}
|
|
|
+ ,#{running,jdbcType= NUMERIC }
|
|
|
+ ,#{acc,jdbcType= NUMERIC }
|
|
|
+ ,#{online,jdbcType= NUMERIC }
|
|
|
+ ,#{latestAddress,jdbcType=VARCHAR}
|
|
|
+ ,#{trailInterval,jdbcType= NUMERIC}
|
|
|
)
|
|
|
]]>
|
|
|
</insert>
|
|
@@ -149,6 +206,90 @@
|
|
|
</select>
|
|
|
<select id="search" parameterType="hashmap" resultMap="VehicleInfoMap">
|
|
|
<![CDATA[
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from bus_vehicle_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.VehicleInfo">
|
|
|
+ update bus_vehicle_info
|
|
|
+ <set>
|
|
|
+ <if test="routeId!=null">
|
|
|
+ route_id=#{routeId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="licensePlateNumber!=null">
|
|
|
+ license_plate_number=#{licensePlateNumber,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="activationCode!=null">
|
|
|
+ activation_code=#{activationCode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="gpsDeviceNo!=null">
|
|
|
+ gps_device_no=#{gpsDeviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo!=null">
|
|
|
+ device_no=#{deviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="picture!=null">
|
|
|
+ picture_=#{picture,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="loadNumber!=null">
|
|
|
+ load_number=#{loadNumber,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="longitude!=null">
|
|
|
+ longitude_=#{longitude,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="latitude!=null">
|
|
|
+ latitude_=#{latitude,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status!=null">
|
|
|
+ status_=#{status,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null">
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null">
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null">
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="companyId!=null">
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="running!=null">
|
|
|
+ running_=#{running,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="acc!=null">
|
|
|
+ acc_=#{acc,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="online!=null">
|
|
|
+ online_=#{online,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="latestAddress!=null">
|
|
|
+ latest_address=#{latestAddress,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="trailInterval!=null">
|
|
|
+ trail_interval=#{trailInterval,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="VehicleInfoMap">
|
|
|
+ select * from bus_vehicle_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from bus_vehicle_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="VehicleInfoMap">
|
|
|
+ select * from bus_vehicle_info
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="VehicleInfoMap">
|
|
|
+ <![CDATA[
|
|
|
SELECT
|
|
|
a.*,
|
|
|
b.name_ AS route_name
|
|
@@ -156,74 +297,74 @@
|
|
|
bus_vehicle_info a
|
|
|
LEFT JOIN bus_route_info b ON a.route_id = b.id_
|
|
|
]]>
|
|
|
- <where>
|
|
|
- a.del_flag=false
|
|
|
- <if test="searchParams.licensePlateNumber != null">
|
|
|
- and a.license_plate_number like #{searchParams.licensePlateNumber}
|
|
|
- </if>
|
|
|
- <if test="searchParams.companyId != null">
|
|
|
- and a.company_id = #{searchParams.companyId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.gpsDeviceNo != null">
|
|
|
- and a.gps_device_no like #{searchParams.gpsDeviceNo}
|
|
|
- </if>
|
|
|
- <if test="searchParams.deviceNo != null">
|
|
|
- and a.device_no like #{searchParams.deviceNo}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
+ <where>
|
|
|
+ a.del_flag=false
|
|
|
+ <if test="searchParams.licensePlateNumber != null">
|
|
|
+ and a.license_plate_number like #{searchParams.licensePlateNumber}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
+ and a.company_id = #{searchParams.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.gpsDeviceNo != null">
|
|
|
+ and a.gps_device_no like #{searchParams.gpsDeviceNo}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.deviceNo != null">
|
|
|
+ and a.device_no like #{searchParams.deviceNo}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByCodeAndCarNum" resultMap="VehicleInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByCodeAndCarNum" resultMap="VehicleInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_vehicle_info
|
|
|
where del_flag = 0
|
|
|
and license_plate_number = #{carNum}
|
|
|
and activation_code = #{activationCode}
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByGpsDeviceNo" resultMap="VehicleInfoMap">
|
|
|
- select * from bus_vehicle_info where del_flag=0 and gps_device_no=#{0}
|
|
|
- order by create_time desc limit 1
|
|
|
- </select>
|
|
|
+ <select id="findByGpsDeviceNo" resultMap="VehicleInfoMap">
|
|
|
+ select * from bus_vehicle_info where del_flag=0 and gps_device_no=#{0}
|
|
|
+ order by create_time desc limit 1
|
|
|
+ </select>
|
|
|
|
|
|
- <update id="updateGps" parameterType="com.jpsoft.bus.modules.bus.entity.VehicleInfo">
|
|
|
- update bus_vehicle_info
|
|
|
- <set>
|
|
|
- update_time=now(),
|
|
|
- running_=1,
|
|
|
+ <update id="updateGps" parameterType="com.jpsoft.bus.modules.bus.entity.VehicleInfo">
|
|
|
+ update bus_vehicle_info
|
|
|
+ <set>
|
|
|
+ update_time=now(),
|
|
|
+ running_=1,
|
|
|
online_=1,
|
|
|
- <if test="longitude!=null">
|
|
|
- longitude_=#{longitude,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="latitude!=null">
|
|
|
- latitude_=#{latitude,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="latestAddress!=null">
|
|
|
- latest_address=#{latestAddress,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_=#{id}
|
|
|
- </update>
|
|
|
+ <if test="longitude!=null">
|
|
|
+ longitude_=#{longitude,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="latitude!=null">
|
|
|
+ latitude_=#{latitude,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="latestAddress!=null">
|
|
|
+ latest_address=#{latestAddress,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
|
|
|
- <select id="findByCarNum" resultMap="VehicleInfoMap">
|
|
|
- select * from bus_vehicle_info where del_flag=0 and license_plate_number=#{carNum}
|
|
|
- order by create_time desc limit 1
|
|
|
- </select>
|
|
|
+ <select id="findByCarNum" resultMap="VehicleInfoMap">
|
|
|
+ select * from bus_vehicle_info where del_flag=0 and license_plate_number=#{carNum}
|
|
|
+ order by create_time desc limit 1
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByCompanyId" resultMap="VehicleInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByCompanyId" resultMap="VehicleInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_vehicle_info
|
|
|
where del_flag = 0
|
|
|
and company_id = #{companyId}
|
|
|
]]>
|
|
|
- </select>
|
|
|
- <select id="getRunningList" resultMap="VehicleInfoMap">
|
|
|
- select * from bus_vehicle_info
|
|
|
- where del_flag=0
|
|
|
- and running_=1
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
+ <select id="getRunningList" resultMap="VehicleInfoMap">
|
|
|
+ select * from bus_vehicle_info
|
|
|
+ where del_flag=0
|
|
|
+ and running_=1
|
|
|
+ </select>
|
|
|
</mapper>
|