|
@@ -0,0 +1,83 @@
|
|
|
+<?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="cn.com.taiji.beidou.ship.status.mapper.ShipStatusMapper">
|
|
|
+
|
|
|
+ <resultMap id="shipStatusId" type="shipStatusData">
|
|
|
+ <id property="devideNo" column="devide_no"/>
|
|
|
+ <result property="isOnline" column="is_online"/>
|
|
|
+ <result property="isStasis" column="is_stasis"/>
|
|
|
+ <result property="longitude" column="longitude"/>
|
|
|
+ <result property="latitude" column="latitude"/>
|
|
|
+ <result property="location" column="location"/>
|
|
|
+ <result property="kwh" column="kwh"/>
|
|
|
+ <result property="lastTime" column="last_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="shipStatusResult" type="shipStatusResult">
|
|
|
+ <id property="devideNo" column="devide_no"/>
|
|
|
+ <result property="isOnline" column="is_online"/>
|
|
|
+ <result property="isStasis" column="is_stasis"/>
|
|
|
+ <result property="longitude" column="longitude"/>
|
|
|
+ <result property="latitude" column="latitude"/>
|
|
|
+ <result property="location" column="location"/>
|
|
|
+ <result property="kwh" column="kwh"/>
|
|
|
+ <result property="lastTime" column="last_time"/>
|
|
|
+ <result property="shipId" column="ship_id" />
|
|
|
+ <result property="shipType" column="ship_type" />
|
|
|
+ <result property="jobType" column="job_type" />
|
|
|
+ <result property="jobWay" column="job_way" />
|
|
|
+ <result property="ownerName" column="owner_name" />
|
|
|
+ <result property="ownerTelNo" column="owner_tel_no" />
|
|
|
+ <result property="shipLength" column="ship_length" />
|
|
|
+ <result property="shipWidth" column="ship_width" />
|
|
|
+ <result property="shipMaterial" column="ship_material" />
|
|
|
+ <result property="policeStationId" column="police_station_id" />
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
+ <result property="ownerCompany" column="owner_company" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="modifyTime" column="modify_time" />
|
|
|
+ <result property="ownerType" column="owner_type" />
|
|
|
+ <result property="lastStatus" column="last_status" />
|
|
|
+ <result property="locationTime" column="location_time" />
|
|
|
+ <result property="numberDay" column="number_day" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="selectById" parameterType="string" resultMap="shipStatusResult">
|
|
|
+ select st.is_online,st.is_stasis,st.longitude,st.latitude,st.location,st.last_time,
|
|
|
+ (CASE st.kwh WHEN 0 THEN "小于25%" WHEN 1 THEN "大于25%小于50%" WHEN 2 THEN "大于50%小于75%" ELSE "大于75%" END) as kwh,
|
|
|
+ archives.*,dept.pscmc as dept_name,TIMESTAMPDIFF(DAY,st.last_time,NOW()) as number_day from ax_beidou_ship_status st
|
|
|
+ inner join ax_beidou_ship_archives archives
|
|
|
+ inner join ax_beidou_dept dept
|
|
|
+ where st.devide_no = archives.devide_no and archives.police_station_id = dept.pscbh
|
|
|
+ <if test="devideNo != null and devideNo != ''">
|
|
|
+ and st.devide_no = #{devideNo}
|
|
|
+ </if>
|
|
|
+ <if test="isOnline != null and isOnline != ''">
|
|
|
+ and st.is_online = #{isOnline}
|
|
|
+ </if>
|
|
|
+ <if test="isStasis != null and isStasis != ''">
|
|
|
+ and st.is_stasis = #{isStasis}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectShipStatusList" parameterType="shipStatusReq" resultMap="shipStatusResult">
|
|
|
+ select st.is_online,st.is_stasis,st.longitude,st.latitude,st.location,st.last_time,
|
|
|
+ (CASE st.kwh WHEN 0 THEN "小于25%" WHEN 1 THEN "大于25%小于50%" WHEN 2 THEN "大于50%小于75%" ELSE "大于75%" END) as kwh,
|
|
|
+ archives.*,dept.pscmc as dept_name,TIMESTAMPDIFF(DAY,st.last_time,NOW()) as number_day from ax_beidou_ship_status st
|
|
|
+ inner join ax_beidou_ship_archives archives
|
|
|
+ inner join ax_beidou_dept dept
|
|
|
+ where st.devide_no = archives.devide_no and archives.police_station_id = dept.pscbh
|
|
|
+ <if test="isOnline != null and isOnline != ''">
|
|
|
+ and st.is_online = #{isOnline}
|
|
|
+ </if>
|
|
|
+ <if test="isStasis != null and isStasis != ''">
|
|
|
+ and st.is_stasis = #{isStasis}
|
|
|
+ </if>
|
|
|
+ <if test="shipId != null and shipId != ''">and (archives.ship_id like concat('%', #{shipId},'%') or archives.devide_no like concat('%', #{devideNo},'%'))</if>
|
|
|
+ <if test="deptId != null and deptId != ''">and dept.xw_dept_id like concat('%',#{deptId},'%')</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|