|
|
@@ -1,18 +1,251 @@
|
|
|
<?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">
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.railway.business.catenary.mapper.BusFjxgmdMapper">
|
|
|
|
|
|
- <select id="selectById" resultType="com.railway.business.catenary.domain.BusFjxgmd">
|
|
|
- select * from bus_fjxgmd where id = #{id}
|
|
|
+ <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusFjxgmd">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="db" property="db"/>
|
|
|
+ <result column="bm" property="bm"/>
|
|
|
+ <result column="xb" property="xb"/>
|
|
|
+ <result column="qj" property="qj"/>
|
|
|
+ <result column="hb" property="hb"/>
|
|
|
+ <result column="fjlx" property="fjlx"/>
|
|
|
+ <result column="qsglb" property="qsglb"/>
|
|
|
+ <result column="qsgh" property="qsgh"/>
|
|
|
+ <result column="del_flag" property="delFlag"/>
|
|
|
+ <result column="create_by" property="createBy"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_by" property="updateBy"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="dept_name" property="deptName"/>
|
|
|
+ <result column="line_name" property="lineName"/>
|
|
|
+ <result column="station_name" property="stationName"/>
|
|
|
+ <result column="xingbie_text" property="xingbieText"/>
|
|
|
+ <result column="fjlx_text" property="fjlxText"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id,
|
|
|
+ db,
|
|
|
+ bm,
|
|
|
+ xb,
|
|
|
+ qj,
|
|
|
+ hb,
|
|
|
+ fjlx,
|
|
|
+ qsglb,
|
|
|
+ qsgh,
|
|
|
+ del_flag,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.railway.business.catenary.domain.BusFjxgmd">
|
|
|
+ <selectKey keyProperty="id" order="BEFORE" resultType="String">
|
|
|
+ select replace(uuid(), '-', '') from dual
|
|
|
+ </selectKey>
|
|
|
+ INSERT INTO bus_fjxgmd
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test ='null != db'>
|
|
|
+ db,
|
|
|
+ </if>
|
|
|
+ <if test ='null != bm'>
|
|
|
+ bm,
|
|
|
+ </if>
|
|
|
+ <if test ='null != xb'>
|
|
|
+ xb,
|
|
|
+ </if>
|
|
|
+ <if test ='null != qj'>
|
|
|
+ qj,
|
|
|
+ </if>
|
|
|
+ <if test ='null != hb'>
|
|
|
+ hb,
|
|
|
+ </if>
|
|
|
+ <if test ='null != fjlx'>
|
|
|
+ fjlx,
|
|
|
+ </if>
|
|
|
+ <if test ='null != qsglb'>
|
|
|
+ qsglb,
|
|
|
+ </if>
|
|
|
+ <if test ='null != qsgh'>
|
|
|
+ qsgh,
|
|
|
+ </if>
|
|
|
+ <if test ='null != delFlag'>
|
|
|
+ del_flag,
|
|
|
+ </if>
|
|
|
+ <if test ='null != createBy'>
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test ='null != createTime'>
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test ='null != updateBy'>
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test ='null != updateTime'>
|
|
|
+ update_time
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test ='null != db'>
|
|
|
+ #{db},
|
|
|
+ </if>
|
|
|
+ <if test ='null != bm'>
|
|
|
+ #{bm},
|
|
|
+ </if>
|
|
|
+ <if test ='null != xb'>
|
|
|
+ #{xb},
|
|
|
+ </if>
|
|
|
+ <if test ='null != qj'>
|
|
|
+ #{qj},
|
|
|
+ </if>
|
|
|
+ <if test ='null != hb'>
|
|
|
+ #{hb},
|
|
|
+ </if>
|
|
|
+ <if test ='null != fjlx'>
|
|
|
+ #{fjlx},
|
|
|
+ </if>
|
|
|
+ <if test ='null != qsglb'>
|
|
|
+ #{qsglb},
|
|
|
+ </if>
|
|
|
+ <if test ='null != qsgh'>
|
|
|
+ #{qsgh},
|
|
|
+ </if>
|
|
|
+ <if test ='null != delFlag'>
|
|
|
+ #{delFlag},
|
|
|
+ </if>
|
|
|
+ <if test ='null != createBy'>
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test ='null != createTime'>
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test ='null != updateBy'>
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test ='null != updateTime'>
|
|
|
+ #{updateTime}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ UPDATE bus_fjxgmd
|
|
|
+ set del_flag='1'
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.railway.business.catenary.domain.BusFjxgmd">
|
|
|
+ UPDATE bus_fjxgmd
|
|
|
+ <set>
|
|
|
+ <if test ='null != db'>db = #{db},</if>
|
|
|
+ <if test ='null != bm'>bm = #{bm},</if>
|
|
|
+ <if test ='null != xb'>xb = #{xb},</if>
|
|
|
+ <if test ='null != qj'>qj = #{qj},</if>
|
|
|
+ <if test ='null != hb'>hb = #{hb},</if>
|
|
|
+ <if test ='null != fjlx'>fjlx = #{fjlx},</if>
|
|
|
+ <if test ='null != qsglb'>qsglb = #{qsglb},</if>
|
|
|
+ <if test ='null != qsgh'>qsgh = #{qsgh},</if>
|
|
|
+ <if test ='null != delFlag'>del_flag = #{delFlag},</if>
|
|
|
+ <if test ='null != createBy'>create_by = #{createBy},</if>
|
|
|
+ <if test ='null != createTime'>create_time = #{createTime},</if>
|
|
|
+ <if test ='null != updateBy'>update_by = #{updateBy},</if>
|
|
|
+ <if test ='null != updateTime'>update_time = #{updateTime}</if>
|
|
|
+ </set>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getInfo" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ dept.dept_name,
|
|
|
+ l.line_name,
|
|
|
+ s.station_name,
|
|
|
+ dict1.dict_label as xingbie_text,
|
|
|
+ dict2.dict_label as fjlx_text,
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ bus_fjxgmd a
|
|
|
+ LEFT JOIN sys_dept dept ON a.bm = dept.dept_id
|
|
|
+ LEFT JOIN bus_line l ON a.xb = l.line_id
|
|
|
+ LEFT JOIN bus_station s ON a.qj = s.station_id
|
|
|
+ LEFT JOIN sys_dict_data dict1 ON (a.hb = dict1.dict_value AND dict1.dict_type = 'xingbie')
|
|
|
+ LEFT JOIN sys_dict_data dict2 ON (a.fjlx = dict2.dict_value AND dict2.dict_type = 'fjlx')
|
|
|
+ WHERE
|
|
|
+ a.del_flag = '0'
|
|
|
+ AND dept.del_flag = '0'
|
|
|
+ AND l.del_flag = '0'
|
|
|
+ AND s.del_flag = '0'
|
|
|
+ AND a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="getList" resultType="com.railway.business.catenary.domain.BusFjxgmd">
|
|
|
- select * from bus_fjxgmd
|
|
|
+ <select id="getList" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ dept.dept_name,
|
|
|
+ l.line_name,
|
|
|
+ s.station_name,
|
|
|
+ dict1.dict_label as xingbie_text,
|
|
|
+ dict2.dict_label as fjlx_text,
|
|
|
+ a.*
|
|
|
+ FROM
|
|
|
+ bus_fjxgmd a
|
|
|
+ LEFT JOIN sys_dept dept ON a.bm = dept.dept_id
|
|
|
+ LEFT JOIN bus_line l ON a.xb = l.line_id
|
|
|
+ LEFT JOIN bus_station s ON a.qj = s.station_id
|
|
|
+ LEFT JOIN sys_dict_data dict1 ON (a.hb = dict1.dict_value AND dict1.dict_type = 'xingbie')
|
|
|
+ LEFT JOIN sys_dict_data dict2 ON (a.fjlx = dict2.dict_value AND dict2.dict_type = 'fjlx')
|
|
|
+ <where>
|
|
|
+ a.del_flag = '0'
|
|
|
+ AND dept.del_flag = '0'
|
|
|
+ AND l.del_flag = '0'
|
|
|
+ AND s.del_flag = '0'
|
|
|
+ <if test="db!=null and db!=''">
|
|
|
+ and a.db=#{db}
|
|
|
+ </if>
|
|
|
+ <if test="bm!=null and bm!=''">
|
|
|
+ and a.bm=#{bm}
|
|
|
+ </if>
|
|
|
+ <if test="xb!=null and xb!=''">
|
|
|
+ and a.xb=#{xb}
|
|
|
+ </if>
|
|
|
+ <if test="qj!=null and qj!=''">
|
|
|
+ and a.qj=#{qj}
|
|
|
+ </if>
|
|
|
+ <if test="hb!=null and hb!=''">
|
|
|
+ and a.hb=#{hb}
|
|
|
+ </if>
|
|
|
+ <if test="fjlx!=null and fjlx!=''">
|
|
|
+ and a.fjlx=#{fjlx}
|
|
|
+ </if>
|
|
|
+ <if test="qsglb!=null and qsglb!=''">
|
|
|
+ and a.qsglb=#{qsglb}
|
|
|
+ </if>
|
|
|
+ <if test="qsgh!=null and qsgh!=''">
|
|
|
+ and a.qsgh=#{qsgh}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null and delFlag!=''">
|
|
|
+ and a.del_flag=#{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null and createBy!=''">
|
|
|
+ and a.create_by=#{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null and createTime!=''">
|
|
|
+ and a.create_time=#{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null and updateBy!=''">
|
|
|
+ and a.update_by=#{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null and updateTime!=''">
|
|
|
+ and a.update_time=#{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="getListByZz" resultType="com.railway.business.catenary.domain.vo.BusFjxgmdVo">
|
|
|
+ <select id="getListByZz" resultMap="BaseResultMap">
|
|
|
SELECT DISTINCT
|
|
|
- dm.qsgh as zzh,
|
|
|
+ dm.qsgh,
|
|
|
dm.qsglb,
|
|
|
dm.bm,
|
|
|
dm.xb,
|
|
|
@@ -27,30 +260,31 @@
|
|
|
bus_zzdzxx A,
|
|
|
(
|
|
|
SELECT
|
|
|
- zz.id,
|
|
|
- zz.glb
|
|
|
+ zz.id,
|
|
|
+ zz.glb
|
|
|
FROM
|
|
|
- bus_zzdzxx zz
|
|
|
+ bus_zzdzxx zz
|
|
|
WHERE 1=1
|
|
|
- <if test="query.zzh != null and query.zzh != ''">
|
|
|
- AND zz.zzh = #{query.zzh}
|
|
|
- </if>
|
|
|
- <if test="query.bm != null and query.bm != ''">
|
|
|
- AND zz.bm = #{query.bm}
|
|
|
- </if>
|
|
|
- <if test="query.xb != null and query.xb != ''">
|
|
|
- AND zz.xb = #{query.xb}
|
|
|
- </if>
|
|
|
- <if test="query.qj != null and query.qj != ''">
|
|
|
- AND zz.qj = #{query.qj}
|
|
|
- </if>
|
|
|
- <if test="query.hb != null and query.hb != ''">
|
|
|
- AND zz.hb = #{query.hb}
|
|
|
- </if>
|
|
|
+ <if test="query.qsgh != null and query.qsgh != ''">
|
|
|
+ AND zz.zzh = #{query.qsgh}
|
|
|
+ </if>
|
|
|
+ <if test="query.bm != null and query.bm != ''">
|
|
|
+ AND zz.bm = #{query.bm}
|
|
|
+ </if>
|
|
|
+ <if test="query.xb != null and query.xb != ''">
|
|
|
+ AND zz.xb = #{query.xb}
|
|
|
+ </if>
|
|
|
+ <if test="query.qj != null and query.qj != ''">
|
|
|
+ AND zz.qj = #{query.qj}
|
|
|
+ </if>
|
|
|
+ <if test="query.hb != null and query.hb != ''">
|
|
|
+ AND zz.hb = #{query.hb}
|
|
|
+ </if>
|
|
|
) B
|
|
|
WHERE
|
|
|
A.glb BETWEEN B.glb - #{query.zzfw} AND B.glb + #{query.zzfw}
|
|
|
)
|
|
|
ORDER BY dm.qsgh
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|