| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <?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="com.railway.business.catenary.mapper.BusJcebLbjghjlMapper">
- <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebLbjghjl">
- <result column="id" property="id"/>
- <result column="station_id" property="stationId"/>
- <result column="station_name" property="stationName"/>
- <result column="dd" property="dd"/>
- <result column="ghq_mc" property="ghqMc"/>
- <result column="ghq_ggxh" property="ghqGgxh"/>
- <result column="ghq_sccj" property="ghqSccj"/>
- <result column="ghh_mc" property="ghhMc"/>
- <result column="ghh_ggxh" property="ghhGgxh"/>
- <result column="ghh_sccj" property="ghhSccj"/>
- <result column="ghyy" property="ghyy"/>
- <result column="operation_date" property="operationDate"/>
- <result column="operator" property="operator"/>
- <result column="remark" property="remark"/>
- <result column="submit_state" property="submitState"/>
- <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,
- station_id,
- station_name,
- dd,
- ghq_mc,
- ghq_ggxh,
- ghq_sccj,
- ghh_mc,
- ghh_ggxh,
- ghh_sccj,
- ghyy,
- operation_date,
- operator,
- remark,
- submit_state,
- del_flag,
- create_by,
- create_time,
- update_by,
- update_time
- </sql>
- <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebLbjghjl">
- <selectKey keyProperty="id" order="BEFORE" resultType="String">
- select replace(uuid(), '-', '') from dual
- </selectKey>
- INSERT INTO bus_jceb_lbjghjl
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test='null != stationId'>
- station_id,
- </if>
- <if test='null != dd'>
- dd,
- </if>
- <if test='null != ghqMc'>
- ghq_mc,
- </if>
- <if test='null != ghqGgxh'>
- ghq_ggxh,
- </if>
- <if test='null != ghqSccj'>
- ghq_sccj,
- </if>
- <if test='null != ghhMc'>
- ghh_mc,
- </if>
- <if test='null != ghhGgxh'>
- ghh_ggxh,
- </if>
- <if test='null != ghhSccj'>
- ghh_sccj,
- </if>
- <if test='null != ghyy'>
- ghyy,
- </if>
- <if test='null != operationDate'>
- operation_date,
- </if>
- <if test='null != operator'>
- operator,
- </if>
- <if test='null != remark'>
- remark,
- </if>
- <if test='null != submitState'>
- submit_state,
- </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 != dd'>
- #{dd},
- </if>
- <if test='null != ghqMc'>
- #{ghqMc},
- </if>
- <if test='null != ghqGgxh'>
- #{ghqGgxh},
- </if>
- <if test='null != ghqSccj'>
- #{ghqSccj},
- </if>
- <if test='null != ghhMc'>
- #{ghhMc},
- </if>
- <if test='null != ghhGgxh'>
- #{ghhGgxh},
- </if>
- <if test='null != ghhSccj'>
- #{ghhSccj},
- </if>
- <if test='null != ghyy'>
- #{ghyy},
- </if>
- <if test='null != operationDate'>
- #{operationDate},
- </if>
- <if test='null != operator'>
- #{operator},
- </if>
- <if test='null != remark'>
- #{remark},
- </if>
- <if test='null != submitState'>
- #{submitState},
- </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_jceb_lbjghjl
- set del_flag='1'
- WHERE id = #{id}
- </delete>
- <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebLbjghjl">
- UPDATE bus_jceb_lbjghjl
- <set>
- <if test='null != stationId'>station_id = #{stationId},</if>
- <if test='null != dd'>dd = #{dd},</if>
- <if test='null != ghqMc'>ghq_mc = #{ghqMc},</if>
- <if test='null != ghqGgxh'>ghq_ggxh = #{ghqGgxh},</if>
- <if test='null != ghqSccj'>ghq_sccj = #{ghqSccj},</if>
- <if test='null != ghhMc'>ghh_mc = #{ghhMc},</if>
- <if test='null != ghhGgxh'>ghh_ggxh = #{ghhGgxh},</if>
- <if test='null != ghhSccj'>ghh_sccj = #{ghhSccj},</if>
- <if test='null != ghyy'>ghyy = #{ghyy},</if>
- <if test='null != operationDate'>operation_date = #{operationDate},</if>
- <if test='null != operator'>operator = #{operator},</if>
- <if test='null != remark'>remark = #{remark},</if>
- <if test='null != submitState'>submit_state = #{submitState},</if>
- <if test='null != delFlag'>del_flag = #{delFlag},</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
- v.station_name,
- a.*
- FROM bus_jceb_lbjghjl a
- LEFT JOIN v_station v ON a.station_id = v.station_id
- WHERE
- a.del_flag = '0'
- AND s.del_flag = '0'
- AND a.id = #{id}
- </select>
- <select id="getList" resultMap="BaseResultMap">
- SELECT
- v.station_name,
- a.*
- FROM bus_jceb_lbjghjl a
- LEFT JOIN v_station v ON a.station_id = v.station_id
- <where>
- a.del_flag = '0'
- <if test="stationId!=null and stationId!=''">
- and a.station_id=#{stationId}
- </if>
- <if test="dd!=null and dd!=''">
- and a.dd=#{dd}
- </if>
- <if test="ghqMc!=null and ghqMc!=''">
- and a.ghq_mc=#{ghqMc}
- </if>
- <if test="ghqGgxh!=null and ghqGgxh!=''">
- and a.ghq_ggxh=#{ghqGgxh}
- </if>
- <if test="ghqSccj!=null and ghqSccj!=''">
- and a.ghq_sccj=#{ghqSccj}
- </if>
- <if test="ghhMc!=null and ghhMc!=''">
- and a.ghh_mc=#{ghhMc}
- </if>
- <if test="ghhGgxh!=null and ghhGgxh!=''">
- and a.ghh_ggxh=#{ghhGgxh}
- </if>
- <if test="ghhSccj!=null and ghhSccj!=''">
- and a.ghh_sccj=#{ghhSccj}
- </if>
- <if test="ghyy!=null and ghyy!=''">
- and a.ghyy=#{ghyy}
- </if>
- <if test="operationDate!=null and operationDate!=''">
- and a.operation_date=#{operationDate}
- </if>
- <if test="operator!=null and operator!=''">
- and a.operator=#{operator}
- </if>
- <if test="remark!=null and remark!=''">
- and a.remark=#{remark}
- </if>
- <if test="submitState!=null and submitState!=''">
- and a.submit_state=#{submitState}
- </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>
- order by a.operation_date desc
- </select>
- <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
- <result column="dept_name" property="deptName"/>
- <result column="station_name" property="stationName"/>
- <result column="operation_date" property="operationDate"/>
- <result column="operator" property="operator"/>
- <result column="jcebType" property="jcebType"/>
- </resultMap>
- <select id="getListByType" resultMap="JcebResultMap">
- SELECT v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType
- FROM bus_jceb_lbjghjl t
- LEFT JOIN v_station v on t.station_id = v.station_id
- <where>
- t.del_flag='0'
- <if test="stationId!=null and stationId!=''">
- and t.station_id=#{stationId}
- </if>
- <if test="pillarCode!=null and pillarCode!=''">
- and t.pillar_start=#{pillarCode}
- </if>
- <if test="operator!=null and operator!=''">
- and t.operator=#{operator}
- </if>
- </where>
- </select>
- <resultMap id="JcebCountResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
- <result column="c" property="count"/>
- <result column="operation_date" property="operationDate"/>
- </resultMap>
- <select id="getCountByType" resultMap="JcebCountResultMap">
- SELECT count(*) c, max(t.operation_date) as operation_date
- FROM bus_jceb_lbjghjl t
- LEFT JOIN v_station v on t.station_id = v.station_id
- <where>
- t.del_flag='0'
- <if test="stationId!=null and stationId!=''">
- and t.station_id=#{stationId}
- </if>
- <if test="pillarCode!=null and pillarCode!=''">
- and t.pillar_start=#{pillarCode}
- </if>
- <if test="operator!=null and operator!=''">
- and t.operator=#{operator}
- </if>
- </where>
- </select>
- </mapper>
|