|
|
@@ -1,268 +1,219 @@
|
|
|
<?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">
|
|
|
<mapper namespace="com.railway.business.baseinfo.mapper.BusGlkgMapper">
|
|
|
|
|
|
- <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
- <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="zzh" property="zzh"/>
|
|
|
- <result column="glb" property="glb"/>
|
|
|
- <result column="kgbh" property="kgbh"/>
|
|
|
- <result column="sccj" property="sccj"/>
|
|
|
- <result column="kgxh" property="kgxh"/>
|
|
|
- <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"/>
|
|
|
- </resultMap>
|
|
|
+ <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="dept_id" property="deptId"/>
|
|
|
+ <result column="dept_name" property="deptName"/>
|
|
|
+ <result column="line_id" property="lineId"/>
|
|
|
+ <result column="line_name" property="lineName"/>
|
|
|
+ <result column="station_id" property="stationId"/>
|
|
|
+ <result column="station_name" property="stationName"/>
|
|
|
+ <result column="xingbie" property="xingbie"/>
|
|
|
+ <result column="pillar_code" property="pillarCode"/>
|
|
|
+ <result column="marker" property="marker"/>
|
|
|
+ <result column="kgbh" property="kgbh"/>
|
|
|
+ <result column="sccj" property="sccj"/>
|
|
|
+ <result column="kgxh" property="kgxh"/>
|
|
|
+ <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"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <sql id="Base_Column_List">
|
|
|
- id,
|
|
|
- db,
|
|
|
- bm,
|
|
|
- xb,
|
|
|
- qj,
|
|
|
- hb,
|
|
|
- zzh,
|
|
|
- glb,
|
|
|
- kgbh,
|
|
|
- sccj,
|
|
|
- kgxh,
|
|
|
- del_flag,
|
|
|
- create_by,
|
|
|
- create_time,
|
|
|
- update_by,
|
|
|
- update_time
|
|
|
- </sql>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ t.id,
|
|
|
+ v.dept_id,
|
|
|
+ v.dept_name,
|
|
|
+ v.line_id,
|
|
|
+ v.line_name,
|
|
|
+ v.station_name as station_name,
|
|
|
+ t.station_id,
|
|
|
+ t.xingbie,
|
|
|
+ t.pillar_code,
|
|
|
+ t.marker,
|
|
|
+ t.kgbh,
|
|
|
+ t.sccj,
|
|
|
+ t.kgxh,
|
|
|
+ t.del_flag,
|
|
|
+ t.create_by,
|
|
|
+ t.create_time,
|
|
|
+ t.update_by,
|
|
|
+ t.update_time
|
|
|
+ </sql>
|
|
|
|
|
|
- <insert id="insert" parameterType="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
- <selectKey keyProperty="id" order="BEFORE" resultType="String">
|
|
|
- select replace(uuid(), '-', '') from dual
|
|
|
- </selectKey>
|
|
|
- INSERT INTO bus_glkg
|
|
|
- <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 != zzh'>
|
|
|
- zzh,
|
|
|
- </if>
|
|
|
- <if test ='null != glb'>
|
|
|
- glb,
|
|
|
- </if>
|
|
|
- <if test ='null != kgbh'>
|
|
|
- kgbh,
|
|
|
- </if>
|
|
|
- <if test ='null != sccj'>
|
|
|
- sccj,
|
|
|
- </if>
|
|
|
- <if test ='null != kgxh'>
|
|
|
- kgxh,
|
|
|
- </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 != zzh'>
|
|
|
- #{zzh},
|
|
|
- </if>
|
|
|
- <if test ='null != glb'>
|
|
|
- #{glb},
|
|
|
- </if>
|
|
|
- <if test ='null != kgbh'>
|
|
|
- #{kgbh},
|
|
|
- </if>
|
|
|
- <if test ='null != sccj'>
|
|
|
- #{sccj},
|
|
|
- </if>
|
|
|
- <if test ='null != kgxh'>
|
|
|
- #{kgxh},
|
|
|
- </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>
|
|
|
+ <insert id="insert" parameterType="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
+ <selectKey keyProperty="id" order="BEFORE" resultType="String">
|
|
|
+ select replace(uuid(), '-', '') from dual
|
|
|
+ </selectKey>
|
|
|
+ INSERT INTO base_glkg
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test='null != stationId'>
|
|
|
+ station_id,
|
|
|
+ </if>
|
|
|
+ <if test='null != xingbie'>
|
|
|
+ xingbie,
|
|
|
+ </if>
|
|
|
+ <if test='null != pillarCode'>
|
|
|
+ pillar_code,
|
|
|
+ </if>
|
|
|
+ <if test='null != marker'>
|
|
|
+ marker,
|
|
|
+ </if>
|
|
|
+ <if test='null != kgbh'>
|
|
|
+ kgbh,
|
|
|
+ </if>
|
|
|
+ <if test='null != sccj'>
|
|
|
+ sccj,
|
|
|
+ </if>
|
|
|
+ <if test='null != kgxh'>
|
|
|
+ kgxh,
|
|
|
+ </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 != stationId'>
|
|
|
+ #{stationId},
|
|
|
+ </if>
|
|
|
+ <if test='null != xingbie'>
|
|
|
+ #{xingbie},
|
|
|
+ </if>
|
|
|
+ <if test='null != pillarCode'>
|
|
|
+ #{pillarCode},
|
|
|
+ </if>
|
|
|
+ <if test='null != marker'>
|
|
|
+ #{marker},
|
|
|
+ </if>
|
|
|
+ <if test='null != kgbh'>
|
|
|
+ #{kgbh},
|
|
|
+ </if>
|
|
|
+ <if test='null != sccj'>
|
|
|
+ #{sccj},
|
|
|
+ </if>
|
|
|
+ <if test='null != kgxh'>
|
|
|
+ #{kgxh},
|
|
|
+ </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_glkg
|
|
|
- set del_flag='1'
|
|
|
- WHERE id = #{id}
|
|
|
- </delete>
|
|
|
+ <delete id="delete">
|
|
|
+ UPDATE base_glkg
|
|
|
+ set del_flag='1'
|
|
|
+ WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
|
|
|
- <update id="update" parameterType="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
- UPDATE bus_glkg
|
|
|
- <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 != zzh'>zzh = #{zzh},</if>
|
|
|
- <if test ='null != glb'>glb = #{glb},</if>
|
|
|
- <if test ='null != kgbh'>kgbh = #{kgbh},</if>
|
|
|
- <if test ='null != sccj'>sccj = #{sccj},</if>
|
|
|
- <if test ='null != kgxh'>kgxh = #{kgxh},</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>
|
|
|
+ <update id="update" parameterType="com.railway.business.baseinfo.domain.BusGlkg">
|
|
|
+ UPDATE base_glkg
|
|
|
+ <set>
|
|
|
+ <if test='null != stationId'>station_id = #{stationId},</if>
|
|
|
+ <if test='null != xingbie'>xingbie = #{xingbie},</if>
|
|
|
+ <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
|
|
|
+ <if test='null != marker'>marker = #{marker},</if>
|
|
|
+ <if test='null != kgbh'>kgbh = #{kgbh},</if>
|
|
|
+ <if test='null != sccj'>sccj = #{sccj},</if>
|
|
|
+ <if test='null != kgxh'>kgxh = #{kgxh},</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
|
|
|
- DISTINCT
|
|
|
- dept.dept_name,
|
|
|
- l.line_name,
|
|
|
- s.station_name,
|
|
|
- dict.dict_label as xingbie_text,
|
|
|
- a.*
|
|
|
- FROM
|
|
|
- bus_glkg 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 dict ON a.hb = dict.dict_value
|
|
|
- WHERE
|
|
|
- a.del_flag = '0'
|
|
|
- AND dept.del_flag = '0'
|
|
|
- AND l.del_flag = '0'
|
|
|
- AND s.del_flag = '0'
|
|
|
- AND dict.dict_type = 'xingbie'
|
|
|
- AND a.id = #{id}
|
|
|
- </select>
|
|
|
+ <select id="getInfo" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM base_glkg t
|
|
|
+ LEFT JOIN v_station v on t.station_id = v.station_id
|
|
|
+ WHERE t.del_flag='0' and t.id = #{id}
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getList" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
- dept.dept_name,
|
|
|
- l.line_name,
|
|
|
- s.station_name,
|
|
|
- dict.dict_label as xingbie_text,
|
|
|
- a.*
|
|
|
- FROM
|
|
|
- bus_glkg 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 dict ON a.hb = dict.dict_value
|
|
|
- <where>
|
|
|
- a.del_flag = '0'
|
|
|
- AND dept.del_flag = '0'
|
|
|
- AND l.del_flag = '0'
|
|
|
- AND s.del_flag = '0'
|
|
|
- AND dict.dict_type = 'xingbie'
|
|
|
- <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="zzh!=null and zzh!=''">
|
|
|
- and a.zzh=#{zzh}
|
|
|
- </if>
|
|
|
- <if test="glb!=null and glb!=''">
|
|
|
- and a.glb=#{glb}
|
|
|
- </if>
|
|
|
- <if test="kgbh!=null and kgbh!=''">
|
|
|
- and a.kgbh=#{kgbh}
|
|
|
- </if>
|
|
|
- <if test="sccj!=null and sccj!=''">
|
|
|
- and a.sccj=#{sccj}
|
|
|
- </if>
|
|
|
- <if test="kgxh!=null and kgxh!=''">
|
|
|
- and a.kgxh=#{kgxh}
|
|
|
- </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="getList" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM
|
|
|
+ base_glkg t
|
|
|
+ LEFT JOIN v_station v on t.station_id = v.station_id
|
|
|
+ <where>
|
|
|
+ t.del_flag='0'
|
|
|
+ <if test="deptId!=null and deptId!=''">
|
|
|
+ and v.dept_id=#{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="lineId!=null and lineId!=''">
|
|
|
+ and v.line_id=#{lineId}
|
|
|
+ </if>
|
|
|
+ <if test="stationId!=null and stationId!=''">
|
|
|
+ and t.station_id=#{stationId}
|
|
|
+ </if>
|
|
|
+ <if test="xingbie!=null and xingbie!=''">
|
|
|
+ and t.xingbie=#{xingbie}
|
|
|
+ </if>
|
|
|
+ <if test="pillarCode!=null and pillarCode!=''">
|
|
|
+ and t.pillar_code=#{pillarCode}
|
|
|
+ </if>
|
|
|
+ <if test="marker!=null and marker!=''">
|
|
|
+ and t.marker=#{marker}
|
|
|
+ </if>
|
|
|
+ <if test="kgbh!=null and kgbh!=''">
|
|
|
+ and t.kgbh=#{kgbh}
|
|
|
+ </if>
|
|
|
+ <if test="sccj!=null and sccj!=''">
|
|
|
+ and t.sccj=#{sccj}
|
|
|
+ </if>
|
|
|
+ <if test="kgxh!=null and kgxh!=''">
|
|
|
+ and t.kgxh=#{kgxh}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null and delFlag!=''">
|
|
|
+ and t.del_flag=#{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null and createBy!=''">
|
|
|
+ and t.create_by=#{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null and createTime!=''">
|
|
|
+ and t.create_time=#{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null and updateBy!=''">
|
|
|
+ and t.update_by=#{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null and updateTime!=''">
|
|
|
+ and t.update_time=#{updateTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.create_time desc
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|