|
@@ -1,169 +1,168 @@
|
|
|
<?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.StationInfoDAO">
|
|
|
- <resultMap id="StationInfoMap" type="com.jpsoft.bus.modules.bus.entity.StationInfo">
|
|
|
- <id property="id" column="id_" />
|
|
|
- <result property="sortNo" column="sort_no" />
|
|
|
- <result property="routeId" column="route_id" />
|
|
|
- <result property="name" column="name_" />
|
|
|
- <result property="longitude" column="longitude_" />
|
|
|
- <result property="latitude" column="latitude_" />
|
|
|
- <result property="classify" column="classify_" />
|
|
|
- <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.StationInfo">
|
|
|
- <!--
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
- select sys_guid() from dual
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- <![CDATA[
|
|
|
+ <resultMap id="StationInfoMap" type="com.jpsoft.bus.modules.bus.entity.StationInfo">
|
|
|
+ <id property="id" column="id_"/>
|
|
|
+ <result property="sortNo" column="sort_no"/>
|
|
|
+ <result property="routeId" column="route_id"/>
|
|
|
+ <result property="name" column="name_"/>
|
|
|
+ <result property="longitude" column="longitude_"/>
|
|
|
+ <result property="latitude" column="latitude_"/>
|
|
|
+ <result property="classify" column="classify_"/>
|
|
|
+ <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.StationInfo">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
insert into bus_station_info
|
|
|
(id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,update_by,update_time,del_flag,radius_)
|
|
|
values
|
|
|
(
|
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
-,#{sortNo,jdbcType= NUMERIC }
|
|
|
-,#{routeId,jdbcType=VARCHAR}
|
|
|
-,#{name,jdbcType=VARCHAR}
|
|
|
-,#{longitude,jdbcType=DOUBLE}
|
|
|
-,#{latitude,jdbcType=DOUBLE}
|
|
|
-,#{classify,jdbcType= NUMERIC }
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
-,#{radius,jdbcType= NUMERIC }
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{sortNo,jdbcType= NUMERIC }
|
|
|
+ ,#{routeId,jdbcType=VARCHAR}
|
|
|
+ ,#{name,jdbcType=VARCHAR}
|
|
|
+ ,#{longitude,jdbcType=DOUBLE}
|
|
|
+ ,#{latitude,jdbcType=DOUBLE}
|
|
|
+ ,#{classify,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_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
- <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.StationInfo">
|
|
|
- update bus_station_info
|
|
|
- <set>
|
|
|
- <if test="sortNo!=null">
|
|
|
- sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
|
- </if>
|
|
|
- <if test="routeId!=null">
|
|
|
- route_id=#{routeId,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="name!=null">
|
|
|
- name_=#{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="longitude!=null">
|
|
|
- longitude_=#{longitude,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="latitude!=null">
|
|
|
- latitude_=#{latitude,jdbcType=DOUBLE},
|
|
|
- </if>
|
|
|
- <if test="classify!=null">
|
|
|
- classify_=#{classify,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="StationInfoMap">
|
|
|
- select
|
|
|
-id_,sort_no,route_id,name_,longitude_,latitude_,classify_,create_by,create_time,update_by,update_time,del_flag from bus_station_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
- select count(*) from bus_station_info where id_=#{0}
|
|
|
- </select>
|
|
|
- <select id="list" resultMap="StationInfoMap">
|
|
|
- select * from bus_station_info
|
|
|
- </select>
|
|
|
- <select id="findByRouteId" resultMap="StationInfoMap">
|
|
|
- select * from bus_station_info where del_flag = false and route_id = #{0} order by sort_no asc
|
|
|
- </select>
|
|
|
- <select id="search" parameterType="hashmap" resultMap="StationInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from bus_station_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.StationInfo">
|
|
|
+ update bus_station_info
|
|
|
+ <set>
|
|
|
+ <if test="sortNo!=null">
|
|
|
+ sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="routeId!=null">
|
|
|
+ route_id=#{routeId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="name!=null">
|
|
|
+ name_=#{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="longitude!=null">
|
|
|
+ longitude_=#{longitude,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="latitude!=null">
|
|
|
+ latitude_=#{latitude,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="classify!=null">
|
|
|
+ classify_=#{classify,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="StationInfoMap">
|
|
|
+ select * from bus_station_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from bus_station_info where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="StationInfoMap">
|
|
|
+ select * from bus_station_info
|
|
|
+ </select>
|
|
|
+ <select id="findByRouteId" resultMap="StationInfoMap">
|
|
|
+ select * from bus_station_info where del_flag = false and route_id = #{0} order by sort_no asc
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="StationInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select a.* from bus_station_info a
|
|
|
left join bus_route_info b on a.route_id = b.id_
|
|
|
]]>
|
|
|
- <where>
|
|
|
- a.del_flag = 0
|
|
|
- and b.del_flag = 0
|
|
|
- <if test="searchParams.id != null">
|
|
|
- and a.ID_ like #{searchParams.id}
|
|
|
- </if>
|
|
|
- <if test="searchParams.maxLongitude != null">
|
|
|
- <![CDATA[
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ and b.del_flag = 0
|
|
|
+ <if test="searchParams.id != null">
|
|
|
+ and a.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 a.longitude_ >= #{searchParams.minLongitude}
|
|
|
]]>
|
|
|
- </if>
|
|
|
- <if test="searchParams.maxLatitude != null">
|
|
|
- <![CDATA[
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.maxLatitude != null">
|
|
|
+ <![CDATA[
|
|
|
and a.latitude_ <= #{searchParams.maxLatitude}
|
|
|
]]>
|
|
|
- </if>
|
|
|
- <if test="searchParams.minLatitude != null">
|
|
|
- and a.latitude_ >= #{searchParams.minLatitude}
|
|
|
- </if>
|
|
|
- <if test="searchParams.routeId != null">
|
|
|
- and a.route_id like #{searchParams.routeId}
|
|
|
- </if>
|
|
|
- <if test="searchParams.name !=null ">
|
|
|
- and a.name_ like #{searchParams.name}
|
|
|
- </if>
|
|
|
- <if test="searchParams.regionId">
|
|
|
- and b.region_id = #{searchParams.regionId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
- ${sort.name} ${sort.order}
|
|
|
- </foreach>
|
|
|
- </select>
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.minLatitude != null">
|
|
|
+ and a.latitude_ >= #{searchParams.minLatitude}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.routeId != null">
|
|
|
+ and a.route_id like #{searchParams.routeId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.name !=null ">
|
|
|
+ and a.name_ like #{searchParams.name}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.regionId">
|
|
|
+ and b.region_id = #{searchParams.regionId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByRouteIdAndClassify" resultMap="StationInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByRouteIdAndClassify" resultMap="StationInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_station_info
|
|
|
where del_flag = 0
|
|
|
and route_id = #{routeId}
|
|
|
and classify_ = #{classify}
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="findByRouteIdAndName" resultMap="StationInfoMap">
|
|
|
- <![CDATA[
|
|
|
+ <select id="findByRouteIdAndName" resultMap="StationInfoMap">
|
|
|
+ <![CDATA[
|
|
|
select * from bus_station_info
|
|
|
where del_flag = 0
|
|
|
and route_id = #{routeId}
|
|
|
and name_ = #{name}
|
|
|
limit 1
|
|
|
]]>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|