|
@@ -0,0 +1,151 @@
|
|
|
+<?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">
|
|
|
+<!-- namespace必须指向DAO接口 -->
|
|
|
+<mapper namespace="com.jpsoft.bus.modules.bus.dao.VehicleInfoDAO">
|
|
|
+ <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="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" />
|
|
|
+ </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,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)
|
|
|
+ values
|
|
|
+ (
|
|
|
+#{id,jdbcType=VARCHAR}
|
|
|
+,#{routeId,jdbcType=VARCHAR}
|
|
|
+,#{licensePlateNumber,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}
|
|
|
+ )
|
|
|
+ ]]>
|
|
|
+ </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="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>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="VehicleInfoMap">
|
|
|
+ select
|
|
|
+id_,route_id,license_plate_number,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 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 * from bus_vehicle_info
|
|
|
+ ]]>
|
|
|
+ <where>
|
|
|
+ <if test="searchParams.id != null">
|
|
|
+ and ID_ like #{searchParams.id}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+</mapper>
|