|
@@ -1,136 +1,140 @@
|
|
|
<?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">
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<!-- namespace必须指向DAO接口 -->
|
|
|
<mapper namespace="com.jpsoft.bus.modules.bus.dao.StationSubInfoDAO">
|
|
|
- <resultMap id="StationSubInfoMap" type="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
- <id property="id" column="id_" />
|
|
|
- <result property="stationId" column="station_id" />
|
|
|
- <result property="startStationId" column="start_station_id" />
|
|
|
- <result property="endStationId" column="end_station_id" />
|
|
|
- <result property="longitude" column="longitude_" />
|
|
|
- <result property="latitude" column="latitude_" />
|
|
|
- <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" />
|
|
|
- </resultMap>
|
|
|
- <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
- <!--
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
- select sys_guid() from dual
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- <![CDATA[
|
|
|
+ <resultMap id="StationSubInfoMap" type="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
+ <id property="id" column="id_"/>
|
|
|
+ <result property="stationId" column="station_id"/>
|
|
|
+ <result property="startStationId" column="start_station_id"/>
|
|
|
+ <result property="endStationId" column="end_station_id"/>
|
|
|
+ <result property="longitude" column="longitude_"/>
|
|
|
+ <result property="latitude" column="latitude_"/>
|
|
|
+ <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="radius" column="radius_"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
insert into bus_station_sub_info
|
|
|
- (id_,station_id,start_station_id,end_station_id,longitude_,latitude_,create_by,create_time,update_by,update_time,del_flag)
|
|
|
+ (id_,station_id,start_station_id,end_station_id,longitude_,latitude_,create_by,create_time,update_by,update_time,del_flag,radius_)
|
|
|
values
|
|
|
(
|
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
-,#{stationId,jdbcType=VARCHAR}
|
|
|
-,#{startStationId,jdbcType=VARCHAR}
|
|
|
-,#{endStationId,jdbcType=VARCHAR}
|
|
|
-,#{longitude,jdbcType= NUMERIC }
|
|
|
-,#{latitude,jdbcType= NUMERIC }
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{stationId,jdbcType=VARCHAR}
|
|
|
+ ,#{startStationId,jdbcType=VARCHAR}
|
|
|
+ ,#{endStationId,jdbcType=VARCHAR}
|
|
|
+ ,#{longitude,jdbcType= NUMERIC }
|
|
|
+ ,#{latitude,jdbcType= NUMERIC }
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ ,#{radius,jdbcType= NUMERIC }
|
|
|
)
|
|
|
]]>
|
|
|
- </insert>
|
|
|
- <delete id="delete" parameterType="string">
|
|
|
- delete from bus_station_sub_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
- update bus_station_sub_info
|
|
|
- <set>
|
|
|
- <if test="stationId!=null">
|
|
|
- station_id=#{stationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="startStationId!=null">
|
|
|
- start_station_id=#{startStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="endStationId!=null">
|
|
|
- end_station_id=#{endStationId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="longitude!=null">
|
|
|
- longitude_=#{longitude,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="latitude!=null">
|
|
|
- latitude_=#{latitude,jdbcType= NUMERIC },
|
|
|
- </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>
|
|
|
- </set>
|
|
|
- where id_=#{id}
|
|
|
- </update>
|
|
|
- <select id="get" parameterType="string" resultMap="StationSubInfoMap">
|
|
|
- select
|
|
|
-id_,station_id,start_station_id,end_station_id,longitude_,latitude_,create_by,create_time,update_by,update_time,del_flag from bus_station_sub_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
- select count(*) from bus_station_sub_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="list" resultMap="StationSubInfoMap">
|
|
|
- select * from bus_station_sub_info
|
|
|
- </select>
|
|
|
- <select id="search" parameterType="hashmap" resultMap="StationSubInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from bus_station_sub_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.StationSubInfo">
|
|
|
+ update bus_station_sub_info
|
|
|
+ <set>
|
|
|
+ <if test="stationId!=null">
|
|
|
+ station_id=#{stationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="startStationId!=null">
|
|
|
+ start_station_id=#{startStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="endStationId!=null">
|
|
|
+ end_station_id=#{endStationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="longitude!=null">
|
|
|
+ longitude_=#{longitude,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="latitude!=null">
|
|
|
+ latitude_=#{latitude,jdbcType= NUMERIC },
|
|
|
+ </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="radius!=null">
|
|
|
+ radius_=#{radius,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="StationSubInfoMap">
|
|
|
+ select * from bus_station_sub_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from bus_station_sub_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="StationSubInfoMap">
|
|
|
+ select * from bus_station_sub_info
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="StationSubInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_station_sub_info
|
|
|
]]>
|
|
|
- <where>
|
|
|
- <if test="searchParams.id != null">
|
|
|
- and ID_ like #{searchParams.id}
|
|
|
- </if>
|
|
|
- <if test="searchParams.maxLongitude != null">
|
|
|
- <![CDATA[
|
|
|
+ <where>
|
|
|
+ <if test="searchParams.id != null">
|
|
|
+ and ID_ like #{searchParams.id}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.maxLongitude != null">
|
|
|
+ <![CDATA[
|
|
|
and longitude_ <= #{searchParams.maxLongitude}
|
|
|
]]>
|
|
|
- </if>
|
|
|
- <if test="searchParams.minLongitude != null">
|
|
|
- <![CDATA[
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.minLongitude != null">
|
|
|
+ <![CDATA[
|
|
|
and longitude_ >= #{searchParams.minLongitude}
|
|
|
]]>
|
|
|
- </if>
|
|
|
- <if test="searchParams.maxLatitude != null">
|
|
|
- <![CDATA[
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.maxLatitude != null">
|
|
|
+ <![CDATA[
|
|
|
and latitude_ <= #{searchParams.maxLatitude}
|
|
|
]]>
|
|
|
- </if>
|
|
|
- <if test="searchParams.minLatitude != null">
|
|
|
- and latitude_ >= #{searchParams.minLatitude}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.minLatitude != null">
|
|
|
+ and latitude_ >= #{searchParams.minLatitude}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="searchParams.startStationId != null">
|
|
|
- and start_station_id = #{searchParams.startStationId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.endStationId != null">
|
|
|
- and end_station_id = #{searchParams.endStationId}
|
|
|
- </if>
|
|
|
+ <if test="searchParams.startStationId != null">
|
|
|
+ and start_station_id = #{searchParams.startStationId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.endStationId != null">
|
|
|
+ and end_station_id = #{searchParams.endStationId}
|
|
|
+ </if>
|
|
|
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
- <select id="findByStationIdStartEnd" resultMap="StationSubInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="findByStationIdStartEnd" resultMap="StationSubInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_station_sub_info
|
|
|
where del_flag = 0
|
|
|
and station_id = #{stationId}
|
|
@@ -138,5 +142,5 @@ id_,station_id,start_station_id,end_station_id,longitude_,latitude_,create_by,cr
|
|
|
and end_station_id = #{endStationId}
|
|
|
limit 1
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
</mapper>
|