<?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.BusJcbGlkgMapper">

  <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbGlkg">
    <result column="id" property="id"/>
    <result column="dept_id" property="deptId"/>
    <result column="dept_name" property="deptName"/>
    <result column="station_id" property="stationId"/>
    <result column="station_name" property="stationName"/>
    <result column="dept_station_id" property="deptStationId"/>
    <result column="xingbie" property="xingbie"/>
    <result column="xingbie_text" property="xingbieText"/>
    <result column="pillar_code" property="pillarCode"/>
    <result column="kgbh" property="kgbh"/>
    <result column="temperature" property="temperature"/>
    <result column="check_date" property="checkDate"/>
    <result column="jgx_a" property="jgxA"/>
    <result column="jgx_a_desc" property="jgxADesc"/>
    <result column="jgx_b" property="jgxB"/>
    <result column="jgx_b_desc" property="jgxBDesc"/>
    <result column="jgx_c" property="jgxC"/>
    <result column="jgx_c_desc" property="jgxCDesc"/>
    <result column="qdzz_a" property="qdzzA"/>
    <result column="qdzz_a_desc" property="qdzzADesc"/>
    <result column="cdg_a" property="cdgA"/>
    <result column="cdg_a_desc" property="cdgADesc"/>
    <result column="cdg_b" property="cdgB"/>
    <result column="cdg_b_desc" property="cdgBDesc"/>
    <result column="cdg_c" property="cdgC"/>
    <result column="cdg_c_desc" property="cdgCDesc"/>
    <result column="gb_a" property="gbA"/>
    <result column="gb_a_desc" property="gbADesc"/>
    <result column="ctzt_a" property="ctztA"/>
    <result column="ctzt_a_desc" property="ctztADesc"/>
    <result column="ctmtzt_a" property="ctmtztA"/>
    <result column="ctmtzt_a_desc" property="ctmtztADesc"/>
    <result column="hjkzt_a" property="hjkztA"/>
    <result column="hjkzt_a_desc" property="hjkztADesc"/>
    <result column="zcjyzzt_a" property="zcjyzztA"/>
    <result column="zcjyzzt_a_desc" property="zcjyzztADesc"/>
    <result column="yxzt_a" property="yxztA"/>
    <result column="yxzt_a_desc" property="yxztADesc"/>
    <result column="yxzt_b" property="yxztB"/>
    <result column="yxzt_b_desc" property="yxztBDesc"/>
    <result column="yxzt_c" property="yxztC"/>
    <result column="yxzt_c_desc" property="yxztCDesc"/>
    <result column="swyx_1_lcz" property="swyx1Lcz"/>
    <result column="swyx_1_dg" property="swyx1Dg"/>
    <result column="swyx_2_lcz" property="swyx2Lcz"/>
    <result column="swyx_2_dg" property="swyx2Dg"/>
    <result column="zxjl" property="zxjl"/>
    <result column="xjzt_a" property="xjztA"/>
    <result column="xjzt_a_desc" property="xjztADesc"/>
    <result column="xjzt_b" property="xjztB"/>
    <result column="xjzt_b_desc" property="xjztBDesc"/>
    <result column="sdfhsy_a" property="sdfhsyA"/>
    <result column="sdfhsy_a_desc" property="sdfhsyADesc"/>
    <result column="ddfhsy_a" property="ddfhsyA"/>
    <result column="ddfhsy_a_desc" property="ddfhsyADesc"/>
    <result column="ydfhsy_a" property="ydfhsyA"/>
    <result column="ydfhsy_a_desc" property="ydfhsyADesc"/>
    <result column="kgztjdzt_a" property="kgztjdztA"/>
    <result column="kgztjdzt_a_desc" property="kgztjdztADesc"/>
    <result column="kgztjdzt_dzz" property="kgztjdztDzz"/>
    <result column="kgjgxjdzt_a" property="kgjgxjdztA"/>
    <result column="kgjgxjdzt_a_desc" property="kgjgxjdztADesc"/>
    <result column="kgjgxjdzt_dzz" property="kgjgxjdztDzz"/>
    <result column="fzzt" property="fzzt"/>
    <result column="fzzt_desc" property="fzztDesc"/>
    <result column="hzzt" property="hzzt"/>
    <result column="hzzt_desc" property="hzztDesc"/>
    <result column="sbzt" property="sbzt"/>
    <result column="sbzt_desc" property="sbztDesc"/>
    <result column="check_user" property="checkUser"/>
    <result column="confirm_user" property="confirmUser"/>
    <result column="czwt" property="czwt"/>
    <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="submit_state" property="submitState"/>
    <result column="del_flag" property="delFlag"/>
    <result column="xhcj" property="xhcj"/>
    <result column="xiangbie" property="xiangbie"/>
  </resultMap>

  <sql id="Base_Column_List">
    t.id,
    v.dept_id,
    v.dept_name,
    v.station_name,
    v.station_id,
    t.dept_station_id,
    t.xingbie,
    t.pillar_code,
    t.kgbh,
    t.temperature,
    t.check_date,
    t.jgx_a,
    t.jgx_a_desc,
    t.jgx_b,
    t.jgx_b_desc,
    t.jgx_c,
    t.jgx_c_desc,
    t.qdzz_a,
    t.qdzz_a_desc,
    t.cdg_a,
    t.cdg_a_desc,
    t.cdg_b,
    t.cdg_b_desc,
    t.cdg_c,
    t.cdg_c_desc,
    t.gb_a,
    t.gb_a_desc,
    t.ctzt_a,
    t.ctzt_a_desc,
    t.ctmtzt_a,
    t.ctmtzt_a_desc,
    t.hjkzt_a,
    t.hjkzt_a_desc,
    t.zcjyzzt_a,
    t.zcjyzzt_a_desc,
    t.yxzt_a,
    t.yxzt_a_desc,
    t.yxzt_b,
    t.yxzt_b_desc,
    t.yxzt_c,
    t.yxzt_c_desc,
    t.swyx_1_lcz,
    t.swyx_1_dg,
    t.swyx_2_lcz,
    t.swyx_2_dg,
    t.zxjl,
    t.xjzt_a,
    t.xjzt_a_desc,
    t.xjzt_b,
    t.xjzt_b_desc,
    t.sdfhsy_a,
    t.sdfhsy_a_desc,
    t.ddfhsy_a,
    t.ddfhsy_a_desc,
    t.ydfhsy_a,
    t.ydfhsy_a_desc,
    t.kgztjdzt_a,
    t.kgztjdzt_a_desc,
    t.kgztjdzt_dzz,
    t.kgjgxjdzt_a,
    t.kgjgxjdzt_a_desc,
    t.kgjgxjdzt_dzz,
    t.fzzt,
    t.fzzt_desc,
    t.hzzt,
    t.hzzt_desc,
    t.sbzt,
    t.sbzt_desc,
    t.check_user,
    t.confirm_user,
    t.czwt,
    t.create_by,
    t.create_time,
    t.update_by,
    t.update_time,
    t.submit_state,
    t.del_flag
  </sql>

  <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbGlkg">
    <selectKey keyProperty="id" order="AFTER" resultType="Long">
      select @@IDENTITY as id
    </selectKey>
    INSERT INTO bus_jcb_glkg
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test='null != deptStationId'>
        dept_station_id,
      </if>
      <if test='null != xingbie'>
        xingbie,
      </if>
      <if test='null != pillarCode'>
        pillar_code,
      </if>
      <if test='null != kgbh'>
        kgbh,
      </if>
      <if test='null != temperature'>
        temperature,
      </if>
      <if test='null != checkDate'>
        check_date,
      </if>
      <if test='null != jgxA'>
        jgx_a,
      </if>
      <if test='null != jgxADesc'>
        jgx_a_desc,
      </if>
      <if test='null != jgxB'>
        jgx_b,
      </if>
      <if test='null != jgxBDesc'>
        jgx_b_desc,
      </if>
      <if test='null != jgxC'>
        jgx_c,
      </if>
      <if test='null != jgxCDesc'>
        jgx_c_desc,
      </if>
      <if test='null != qdzzA'>
        qdzz_a,
      </if>
      <if test='null != qdzzADesc'>
        qdzz_a_desc,
      </if>
      <if test='null != cdgA'>
        cdg_a,
      </if>
      <if test='null != cdgADesc'>
        cdg_a_desc,
      </if>
      <if test='null != cdgB'>
        cdg_b,
      </if>
      <if test='null != cdgBDesc'>
        cdg_b_desc,
      </if>
      <if test='null != cdgC'>
        cdg_c,
      </if>
      <if test='null != cdgCDesc'>
        cdg_c_desc,
      </if>
      <if test='null != gbA'>
        gb_a,
      </if>
      <if test='null != gbADesc'>
        gb_a_desc,
      </if>
      <if test='null != ctztA'>
        ctzt_a,
      </if>
      <if test='null != ctztADesc'>
        ctzt_a_desc,
      </if>
      <if test='null != ctmtztA'>
        ctmtzt_a,
      </if>
      <if test='null != ctmtztADesc'>
        ctmtzt_a_desc,
      </if>
      <if test='null != hjkztA'>
        hjkzt_a,
      </if>
      <if test='null != hjkztADesc'>
        hjkzt_a_desc,
      </if>
      <if test='null != zcjyzztA'>
        zcjyzzt_a,
      </if>
      <if test='null != zcjyzztADesc'>
        zcjyzzt_a_desc,
      </if>
      <if test='null != yxztA'>
        yxzt_a,
      </if>
      <if test='null != yxztADesc'>
        yxzt_a_desc,
      </if>
      <if test='null != yxztB'>
        yxzt_b,
      </if>
      <if test='null != yxztBDesc'>
        yxzt_b_desc,
      </if>
      <if test='null != yxztC'>
        yxzt_c,
      </if>
      <if test='null != yxztCDesc'>
        yxzt_c_desc,
      </if>
      <if test='null != swyx1Lcz'>
        swyx_1_lcz,
      </if>
      <if test='null != swyx1Dg'>
        swyx_1_dg,
      </if>
      <if test='null != swyx2Lcz'>
        swyx_2_lcz,
      </if>
      <if test='null != swyx2Dg'>
        swyx_2_dg,
      </if>
      <if test='null != zxjl'>
        zxjl,
      </if>
      <if test='null != xjztA'>
        xjzt_a,
      </if>
      <if test='null != xjztADesc'>
        xjzt_a_desc,
      </if>
      <if test='null != xjztB'>
        xjzt_b,
      </if>
      <if test='null != xjztBDesc'>
        xjzt_b_desc,
      </if>
      <if test='null != sdfhsyA'>
        sdfhsy_a,
      </if>
      <if test='null != sdfhsyADesc'>
        sdfhsy_a_desc,
      </if>
      <if test='null != ddfhsyA'>
        ddfhsy_a,
      </if>
      <if test='null != ddfhsyADesc'>
        ddfhsy_a_desc,
      </if>
      <if test='null != ydfhsyA'>
        ydfhsy_a,
      </if>
      <if test='null != ydfhsyADesc'>
        ydfhsy_a_desc,
      </if>
      <if test='null != kgztjdztA'>
        kgztjdzt_a,
      </if>
      <if test='null != kgztjdztADesc'>
        kgztjdzt_a_desc,
      </if>
      <if test='null != kgztjdztDzz'>
        kgztjdzt_dzz,
      </if>
      <if test='null != kgjgxjdztA'>
        kgjgxjdzt_a,
      </if>
      <if test='null != kgjgxjdztADesc'>
        kgjgxjdzt_a_desc,
      </if>
      <if test='null != kgjgxjdztDzz'>
        kgjgxjdzt_dzz,
      </if>
      <if test ='null != fzzt'>
        fzzt,
      </if>
      <if test ='null != fzztDesc'>
        fzzt_desc,
      </if>
      <if test ='null != hzzt'>
        hzzt,
      </if>
      <if test ='null != hzztDesc'>
        hzzt_desc,
      </if>
      <if test='null != sbzt'>
        sbzt,
      </if>
      <if test='null != sbztDesc'>
        sbzt_desc,
      </if>
      <if test='null != checkUser'>
        check_user,
      </if>
      <if test='null != confirmUser'>
        confirm_user,
      </if>
      <if test='null != czwt'>
        czwt,
      </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>
      <if test='null != submitState'>
        submit_state,
      </if>
      <if test='null != delFlag'>
        del_flag
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test='null != deptStationId'>
        #{deptStationId},
      </if>
      <if test='null != xingbie'>
        #{xingbie},
      </if>
      <if test='null != pillarCode'>
        #{pillarCode},
      </if>
      <if test='null != kgbh'>
        #{kgbh},
      </if>
      <if test='null != temperature'>
        #{temperature},
      </if>
      <if test='null != checkDate'>
        #{checkDate},
      </if>
      <if test='null != jgxA'>
        #{jgxA},
      </if>
      <if test='null != jgxADesc'>
        #{jgxADesc},
      </if>
      <if test='null != jgxB'>
        #{jgxB},
      </if>
      <if test='null != jgxBDesc'>
        #{jgxBDesc},
      </if>
      <if test='null != jgxC'>
        #{jgxC},
      </if>
      <if test='null != jgxCDesc'>
        #{jgxCDesc},
      </if>
      <if test='null != qdzzA'>
        #{qdzzA},
      </if>
      <if test='null != qdzzADesc'>
        #{qdzzADesc},
      </if>
      <if test='null != cdgA'>
        #{cdgA},
      </if>
      <if test='null != cdgADesc'>
        #{cdgADesc},
      </if>
      <if test='null != cdgB'>
        #{cdgB},
      </if>
      <if test='null != cdgBDesc'>
        #{cdgBDesc},
      </if>
      <if test='null != cdgC'>
        #{cdgC},
      </if>
      <if test='null != cdgCDesc'>
        #{cdgCDesc},
      </if>
      <if test='null != gbA'>
        #{gbA},
      </if>
      <if test='null != gbADesc'>
        #{gbADesc},
      </if>
      <if test='null != ctztA'>
        #{ctztA},
      </if>
      <if test='null != ctztADesc'>
        #{ctztADesc},
      </if>
      <if test='null != ctmtztA'>
        #{ctmtztA},
      </if>
      <if test='null != ctmtztADesc'>
        #{ctmtztADesc},
      </if>
      <if test='null != hjkztA'>
        #{hjkztA},
      </if>
      <if test='null != hjkztADesc'>
        #{hjkztADesc},
      </if>
      <if test='null != zcjyzztA'>
        #{zcjyzztA},
      </if>
      <if test='null != zcjyzztADesc'>
        #{zcjyzztADesc},
      </if>
      <if test='null != yxztA'>
        #{yxztA},
      </if>
      <if test='null != yxztADesc'>
        #{yxztADesc},
      </if>
      <if test='null != yxztB'>
        #{yxztB},
      </if>
      <if test='null != yxztBDesc'>
        #{yxztBDesc},
      </if>
      <if test='null != yxztC'>
        #{yxztC},
      </if>
      <if test='null != yxztCDesc'>
        #{yxztCDesc},
      </if>
      <if test='null != swyx1Lcz'>
        #{swyx1Lcz},
      </if>
      <if test='null != swyx1Dg'>
        #{swyx1Dg},
      </if>
      <if test='null != swyx2Lcz'>
        #{swyx2Lcz},
      </if>
      <if test='null != swyx2Dg'>
        #{swyx2Dg},
      </if>
      <if test='null != zxjl'>
        #{zxjl},
      </if>
      <if test='null != xjztA'>
        #{xjztA},
      </if>
      <if test='null != xjztADesc'>
        #{xjztADesc},
      </if>
      <if test='null != xjztB'>
        #{xjztB},
      </if>
      <if test='null != xjztBDesc'>
        #{xjztBDesc},
      </if>
      <if test='null != sdfhsyA'>
        #{sdfhsyA},
      </if>
      <if test='null != sdfhsyADesc'>
        #{sdfhsyADesc},
      </if>
      <if test='null != ddfhsyA'>
        #{ddfhsyA},
      </if>
      <if test='null != ddfhsyADesc'>
        #{ddfhsyADesc},
      </if>
      <if test='null != ydfhsyA'>
        #{ydfhsyA},
      </if>
      <if test='null != ydfhsyADesc'>
        #{ydfhsyADesc},
      </if>
      <if test='null != kgztjdztA'>
        #{kgztjdztA},
      </if>
      <if test='null != kgztjdztADesc'>
        #{kgztjdztADesc},
      </if>
      <if test='null != kgztjdztDzz'>
        #{kgztjdztDzz},
      </if>
      <if test='null != kgjgxjdztA'>
        #{kgjgxjdztA},
      </if>
      <if test='null != kgjgxjdztADesc'>
        #{kgjgxjdztADesc},
      </if>
      <if test='null != kgjgxjdztDzz'>
        #{kgjgxjdztDzz},
      </if>
      <if test ='null != fzzt'>
        #{fzzt},
      </if>
      <if test ='null != fzztDesc'>
        #{fzztDesc},
      </if>
      <if test ='null != hzzt'>
        #{hzzt},
      </if>
      <if test ='null != hzztDesc'>
        #{hzztDesc},
      </if>
      <if test='null != sbzt'>
        #{sbzt},
      </if>
      <if test='null != sbztDesc'>
        #{sbztDesc},
      </if>
      <if test='null != checkUser'>
        #{checkUser},
      </if>
      <if test='null != confirmUser'>
        #{confirmUser},
      </if>
      <if test='null != czwt'>
        #{czwt},
      </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>
      <if test='null != submitState'>
        #{submitState},
      </if>
      <if test='null != delFlag'>
        #{delFlag}
      </if>
    </trim>
  </insert>

  <delete id="delete">
    UPDATE bus_jcb_glkg
    set del_flag='1'
    WHERE id = #{id}
  </delete>

  <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbGlkg">
    UPDATE bus_jcb_glkg
    <set>
      <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
      <if test='null != xingbie'>xingbie = #{xingbie},</if>
      <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
      <if test='null != kgbh'>kgbh = #{kgbh},</if>
      <if test='null != temperature'>temperature = #{temperature},</if>
      <if test='null != checkDate'>check_date = #{checkDate},</if>
      <if test='null != jgxA'>jgx_a = #{jgxA},</if>
      <if test='null != jgxADesc'>jgx_a_desc = #{jgxADesc},</if>
      <if test='null != jgxB'>jgx_b = #{jgxB},</if>
      <if test='null != jgxBDesc'>jgx_b_desc = #{jgxBDesc},</if>
      <if test='null != jgxC'>jgx_c = #{jgxC},</if>
      <if test='null != jgxCDesc'>jgx_c_desc = #{jgxCDesc},</if>
      <if test='null != qdzzA'>qdzz_a = #{qdzzA},</if>
      <if test='null != qdzzADesc'>qdzz_a_desc = #{qdzzADesc},</if>
      <if test='null != cdgA'>cdg_a = #{cdgA},</if>
      <if test='null != cdgADesc'>cdg_a_desc = #{cdgADesc},</if>
      <if test='null != cdgB'>cdg_b = #{cdgB},</if>
      <if test='null != cdgBDesc'>cdg_b_desc = #{cdgBDesc},</if>
      <if test='null != cdgC'>cdg_c = #{cdgC},</if>
      <if test='null != cdgCDesc'>cdg_c_desc = #{cdgCDesc},</if>
      <if test='null != gbA'>gb_a = #{gbA},</if>
      <if test='null != gbADesc'>gb_a_desc = #{gbADesc},</if>
      <if test='null != ctztA'>ctzt_a = #{ctztA},</if>
      <if test='null != ctztADesc'>ctzt_a_desc = #{ctztADesc},</if>
      <if test='null != ctmtztA'>ctmtzt_a = #{ctmtztA},</if>
      <if test='null != ctmtztADesc'>ctmtzt_a_desc = #{ctmtztADesc},</if>
      <if test='null != hjkztA'>hjkzt_a = #{hjkztA},</if>
      <if test='null != hjkztADesc'>hjkzt_a_desc = #{hjkztADesc},</if>
      <if test='null != zcjyzztA'>zcjyzzt_a = #{zcjyzztA},</if>
      <if test='null != zcjyzztADesc'>zcjyzzt_a_desc = #{zcjyzztADesc},</if>
      <if test='null != yxztA'>yxzt_a = #{yxztA},</if>
      <if test='null != yxztADesc'>yxzt_a_desc = #{yxztADesc},</if>
      <if test='null != yxztB'>yxzt_b = #{yxztB},</if>
      <if test='null != yxztBDesc'>yxzt_b_desc = #{yxztBDesc},</if>
      <if test='null != yxztC'>yxzt_c = #{yxztC},</if>
      <if test='null != yxztCDesc'>yxzt_c_desc = #{yxztCDesc},</if>
      <if test='null != swyx1Lcz'>swyx_1_lcz = #{swyx1Lcz},</if>
      <if test='null != swyx1Dg'>swyx_1_dg = #{swyx1Dg},</if>
      <if test='null != swyx2Lcz'>swyx_2_lcz = #{swyx2Lcz},</if>
      <if test='null != swyx2Dg'>swyx_2_dg = #{swyx2Dg},</if>
      <if test='null != zxjl'>zxjl = #{zxjl},</if>
      <if test='null != xjztA'>xjzt_a = #{xjztA},</if>
      <if test='null != xjztADesc'>xjzt_a_desc = #{xjztADesc},</if>
      <if test='null != xjztB'>xjzt_b = #{xjztB},</if>
      <if test='null != xjztBDesc'>xjzt_b_desc = #{xjztBDesc},</if>
      <if test='null != sdfhsyA'>sdfhsy_a = #{sdfhsyA},</if>
      <if test='null != sdfhsyADesc'>sdfhsy_a_desc = #{sdfhsyADesc},</if>
      <if test='null != ddfhsyA'>ddfhsy_a = #{ddfhsyA},</if>
      <if test='null != ddfhsyADesc'>ddfhsy_a_desc = #{ddfhsyADesc},</if>
      <if test='null != ydfhsyA'>ydfhsy_a = #{ydfhsyA},</if>
      <if test='null != ydfhsyADesc'>ydfhsy_a_desc = #{ydfhsyADesc},</if>
      <if test='null != kgztjdztA'>kgztjdzt_a = #{kgztjdztA},</if>
      <if test='null != kgztjdztADesc'>kgztjdzt_a_desc = #{kgztjdztADesc},</if>
      <if test='null != kgztjdztDzz'>kgztjdzt_dzz = #{kgztjdztDzz},</if>
      <if test='null != kgjgxjdztA'>kgjgxjdzt_a = #{kgjgxjdztA},</if>
      <if test='null != kgjgxjdztADesc'>kgjgxjdzt_a_desc = #{kgjgxjdztADesc},</if>
      <if test='null != kgjgxjdztDzz'>kgjgxjdzt_dzz = #{kgjgxjdztDzz},</if>
      <if test='null != fzzt'>fzzt = #{fzzt},</if>
      <if test='null != fzztDesc'>fzzt_desc = #{fzztDesc},</if>
      <if test='null != hzzt'>hzzt = #{hzzt},</if>
      <if test='null != hzztDesc'>hzzt_desc = #{hzztDesc},</if>
      <if test='null != sbzt'>sbzt = #{sbzt},</if>
      <if test='null != sbztDesc'>sbzt_desc = #{sbztDesc},</if>
      <if test='null != checkUser'>check_user = #{checkUser},</if>
      <if test='null != confirmUser'>confirm_user = #{confirmUser},</if>
      <if test='null != czwt'>czwt = #{czwt},</if>
      <if test='null != updateBy'>update_by = #{updateBy},</if>
      <if test='null != updateTime'>update_time = #{updateTime},</if>
      <if test='null != submitState'>submit_state = #{submitState},</if>
      <if test='null != delFlag'>del_flag = #{delFlag}</if>
    </set>
    WHERE id = #{id}
  </update>


  <select id="getInfo" resultMap="BaseResultMap">
    SELECT
    distinct
    <include refid="Base_Column_List"/>
    FROM
    bus_jcb_glkg t
    LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
    WHERE
    t.del_flag = '0'
    AND t.id = #{id}
  </select>

  <select id="getList" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM
    bus_jcb_glkg t
    LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
    <where>
      t.del_flag = '0'
      <if test="deptId!=null and deptId!=''">
        and v.dept_id=#{deptId}
      </if>
      <if test="stationId!=null and stationId!=''">
        and v.station_id=#{stationId}
      </if>
      <if test="stationIds!=null and stationIds.length > 0">
        and v.station_id in
        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
          #{stationId}
        </foreach>
      </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="kgbh!=null and kgbh!=''">
        and t.kgbh=#{kgbh}
      </if>
      <if test="temperature!=null and temperature!=''">
        and t.temperature=#{temperature}
      </if>
      <if test="checkDate!=null">
        and t.check_date=#{checkDate}
      </if>
      <if test="jgxA!=null and jgxA!=''">
        and t.jgx_a=#{jgxA}
      </if>
      <if test="jgxADesc!=null and jgxADesc!=''">
        and t.jgx_a_desc=#{jgxADesc}
      </if>
      <if test="jgxB!=null and jgxB!=''">
        and t.jgx_b=#{jgxB}
      </if>
      <if test="jgxBDesc!=null and jgxBDesc!=''">
        and t.jgx_b_desc=#{jgxBDesc}
      </if>
      <if test="jgxC!=null and jgxC!=''">
        and t.jgx_c=#{jgxC}
      </if>
      <if test="jgxCDesc!=null and jgxCDesc!=''">
        and t.jgx_c_desc=#{jgxCDesc}
      </if>
      <if test="qdzzA!=null and qdzzA!=''">
        and t.qdzz_a=#{qdzzA}
      </if>
      <if test="qdzzADesc!=null and qdzzADesc!=''">
        and t.qdzz_a_desc=#{qdzzADesc}
      </if>
      <if test="cdgA!=null and cdgA!=''">
        and t.cdg_a=#{cdgA}
      </if>
      <if test="cdgADesc!=null and cdgADesc!=''">
        and t.cdg_a_desc=#{cdgADesc}
      </if>
      <if test="cdgB!=null and cdgB!=''">
        and t.cdg_b=#{cdgB}
      </if>
      <if test="cdgBDesc!=null and cdgBDesc!=''">
        and t.cdg_b_desc=#{cdgBDesc}
      </if>
      <if test="cdgC!=null and cdgC!=''">
        and t.cdg_c=#{cdgC}
      </if>
      <if test="cdgCDesc!=null and cdgCDesc!=''">
        and t.cdg_c_desc=#{cdgCDesc}
      </if>
      <if test="gbA!=null and gbA!=''">
        and t.gb_a=#{gbA}
      </if>
      <if test="gbADesc!=null and gbADesc!=''">
        and t.gb_a_desc=#{gbADesc}
      </if>
      <if test="ctztA!=null and ctztA!=''">
        and t.ctzt_a=#{ctztA}
      </if>
      <if test="ctztADesc!=null and ctztADesc!=''">
        and t.ctzt_a_desc=#{ctztADesc}
      </if>
      <if test="ctmtztA!=null and ctmtztA!=''">
        and t.ctmtzt_a=#{ctmtztA}
      </if>
      <if test="ctmtztADesc!=null and ctmtztADesc!=''">
        and t.ctmtzt_a_desc=#{ctmtztADesc}
      </if>
      <if test="hjkztA!=null and hjkztA!=''">
        and t.hjkzt_a=#{hjkztA}
      </if>
      <if test="hjkztADesc!=null and hjkztADesc!=''">
        and t.hjkzt_a_desc=#{hjkztADesc}
      </if>
      <if test="zcjyzztA!=null and zcjyzztA!=''">
        and t.zcjyzzt_a=#{zcjyzztA}
      </if>
      <if test="zcjyzztADesc!=null and zcjyzztADesc!=''">
        and t.zcjyzzt_a_desc=#{zcjyzztADesc}
      </if>
      <if test="yxztA!=null and yxztA!=''">
        and t.yxzt_a=#{yxztA}
      </if>
      <if test="yxztADesc!=null and yxztADesc!=''">
        and t.yxzt_a_desc=#{yxztADesc}
      </if>
      <if test="yxztB!=null and yxztB!=''">
        and t.yxzt_b=#{yxztB}
      </if>
      <if test="yxztBDesc!=null and yxztBDesc!=''">
        and t.yxzt_b_desc=#{yxztBDesc}
      </if>
      <if test="yxztC!=null and yxztC!=''">
        and t.yxzt_c=#{yxztC}
      </if>
      <if test="yxztCDesc!=null and yxztCDesc!=''">
        and t.yxzt_c_desc=#{yxztCDesc}
      </if>
      <if test="swyx1Lcz!=null and swyx1Lcz!=''">
        and t.swyx_1_lcz=#{swyx1Lcz}
      </if>
      <if test="swyx1Dg!=null and swyx1Dg!=''">
        and t.swyx_1_dg=#{swyx1Dg}
      </if>
      <if test="swyx2Lcz!=null and swyx2Lcz!=''">
        and t.swyx_2_lcz=#{swyx2Lcz}
      </if>
      <if test="swyx2Dg!=null and swyx2Dg!=''">
        and t.swyx_2_dg=#{swyx2Dg}
      </if>
      <if test="zxjl!=null and zxjl!=''">
        and zxjl=#{zxjl}
      </if>
      <if test="xjztA!=null and xjztA!=''">
        and t.xjzt_a=#{xjztA}
      </if>
      <if test="xjztADesc!=null and xjztADesc!=''">
        and t.xjzt_a_desc=#{xjztADesc}
      </if>
      <if test="xjztB!=null and xjztB!=''">
        and t.xjzt_b=#{xjztB}
      </if>
      <if test="xjztBDesc!=null and xjztBDesc!=''">
        and t.xjzt_b_desc=#{xjztBDesc}
      </if>
      <if test="sdfhsyA!=null and sdfhsyA!=''">
        and t.sdfhsy_a=#{sdfhsyA}
      </if>
      <if test="sdfhsyADesc!=null and sdfhsyADesc!=''">
        and t.sdfhsy_a_desc=#{sdfhsyADesc}
      </if>
      <if test="ddfhsyA!=null and ddfhsyA!=''">
        and t.ddfhsy_a=#{ddfhsyA}
      </if>
      <if test="ddfhsyADesc!=null and ddfhsyADesc!=''">
        and t.ddfhsy_a_desc=#{ddfhsyADesc}
      </if>
      <if test="ydfhsyA!=null and ydfhsyA!=''">
        and t.ydfhsy_a=#{ydfhsyA}
      </if>
      <if test="ydfhsyADesc!=null and ydfhsyADesc!=''">
        and t.ydfhsy_a_desc=#{ydfhsyADesc}
      </if>
      <if test="kgztjdztA!=null and kgztjdztA!=''">
        and t.kgztjdzt_a=#{kgztjdztA}
      </if>
      <if test="kgztjdztADesc!=null and kgztjdztADesc!=''">
        and t.kgztjdzt_a_desc=#{kgztjdztADesc}
      </if>
      <if test="kgztjdztDzz!=null and kgztjdztDzz!=''">
        and t.kgztjdzt_dzz=#{kgztjdztDzz}
      </if>
      <if test="kgjgxjdztA!=null and kgjgxjdztA!=''">
        and t.kgjgxjdzt_a=#{kgjgxjdztA}
      </if>
      <if test="kgjgxjdztADesc!=null and kgjgxjdztADesc!=''">
        and t.kgjgxjdzt_a_desc=#{kgjgxjdztADesc}
      </if>
      <if test="kgjgxjdztDzz!=null and kgjgxjdztDzz!=''">
        and t.kgjgxjdzt_dzz=#{kgjgxjdztDzz}
      </if>
      <if test="fzzt!=null and fzzt!=''">
        and t.fzzt=#{fzzt}
      </if>
      <if test="fzztDesc!=null and fzztDesc!=''">
        and t.fzzt_desc=#{fzztDesc}
      </if>
      <if test="hzzt!=null and hzzt!=''">
        and t.hzzt=#{hzzt}
      </if>
      <if test="hzztDesc!=null and hzztDesc!=''">
        and t.hzzt_desc=#{hzztDesc}
      </if>
      <if test="sbzt!=null and sbzt!=''">
        and t.sbzt=#{sbzt}
      </if>
      <if test="sbztDesc!=null and sbztDesc!=''">
        and t.sbzt_desc=#{sbztDesc}
      </if>
      <if test="checkUser!=null and checkUser!=''">
        and t.check_user=#{checkUser}
      </if>
      <if test="confirmUser!=null and confirmUser!=''">
        and t.confirm_user=#{confirmUser}
      </if>
      <if test="czwt!=null and czwt!=''">
        and t.czwt=#{czwt}
      </if>
      <if test="createBy!=null and createBy!=''">
        and t.create_by=#{createBy}
      </if>
      <if test="createTime!=null">
        and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
      </if>
      <if test="updateBy!=null and updateBy!=''">
        and t.update_by=#{updateBy}
      </if>
      <if test="updateTime!=null">
        and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
      </if>
      <if test="submitState!=null and submitState!=''">
        and t.submit_state <![CDATA[ >= ]]> #{submitState}
      </if>
      <if test="delFlag!=null and delFlag!=''">
        and t.del_flag=#{delFlag}
      </if>
    </where>
    <if test="orderBy!=null and orderBy!=''">
      order by t.${orderBy}
    </if>
    <if test="isAsc!=null and isAsc!=''">
      <if test="isAsc == '1'.toString()">
        asc
      </if>
      <if test="isAsc == '0'.toString()">
        desc
      </if>
    </if>
  </select>

  <select id="getLastOne" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>
    FROM
        bus_jcb_glkg t
    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
    WHERE
        t.del_flag = '0' and t.submit_state in ('1','9')
    <if test="stationId!=null and stationId!=''">
      and v.station_id=#{stationId}
    </if>
    <if test="pillarCode!=null and pillarCode!=''">
      and t.pillar_code=#{pillarCode}
    </if>
    <if test="kgbh!=null and kgbh!=''">
      and t.kgbh=#{kgbh}
    </if>
    ORDER BY
        t.update_time DESC
    LIMIT 1
  </select>

  <select id="getJcebList" resultMap="BaseResultMap">
    SELECT
    <include refid="Base_Column_List"/>,
    '检测' as xiangbie,
    concat(bg.sccj,'/',bg.kgxh) as xhcj
    FROM bus_jcb_glkg t
    LEFT JOIN  v_station v ON t.dept_station_id = v.dept_station_id
    LEFT JOIN  base_glkg bg ON (t.dept_station_id = bg.dept_station_id and t.kgbh = bg.kgbh)
    <where>
      t.del_flag='0'
      <if test="submitState!=null and submitState!=''">
        and t.submit_state <![CDATA[ >= ]]> #{submitState}
      </if>
      <if test="deptId!=null and deptId!=''">
        and v.dept_id=#{deptId}
      </if>
      <if test="stationId!=null and stationId!=''">
        and v.station_id=#{stationId}
      </if>
      <if test="stationIds!=null and stationIds.length > 0">
        and v.station_id in
        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
          #{stationId}
        </foreach>
      </if>
      <if test="pillarCode!=null and pillarCode!=''">
        and t.pillar_code=#{pillarCode}
      </if>
      <if test="operator!=null and operator!=''">
        and t.check_user like concat('%', #{operator}, '%')
      </if>
      <if test="createBy!=null and createBy!=''">
        and t.create_by=#{createBy}
      </if>
      <if test="operationDate!=null">
        and t.check_date=#{operationDate}
      </if>
    </where>
  </select>

  <resultMap id="JcabResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
    <result column="id" property="id"/>
    <result column="dept_name" property="deptName"/>
    <result column="station_name" property="stationName"/>
    <result column="check_date" property="operationDate"/>
    <result column="check_user" property="operator"/>
    <result column="jcebType" property="jcebType"/>
  </resultMap>

  <select id="getListByType" resultMap="JcabResultMap">
    SELECT t.id, v.dept_name, v.station_name, t.check_date, t.check_user, #{jcebType} as jcebType
    FROM bus_jcb_glkg t
    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
    <where>
      t.del_flag='0'
      <if test="submitState!=null and submitState!=''">
        and t.submit_state <![CDATA[ >= ]]> #{submitState}
      </if>
      <if test="deptId!=null and deptId!=''">
        and v.dept_id=#{deptId}
      </if>
      <if test="stationId!=null and stationId!=''">
        and v.station_id=#{stationId}
      </if>
      <if test="stationIds!=null and stationIds.length > 0">
        and v.station_id in
        <foreach collection="stationIds" item="stationId" index="i" open="(" separator="," close=")">
          #{stationId}
        </foreach>
      </if>
      <if test="pillarCode!=null and pillarCode!=''">
        and t.pillar_code=#{pillarCode}
      </if>
      <if test="operator!=null and operator!=''">
        and t.check_user like concat('%', #{operator}, '%')
      </if>
      <if test="createBy!=null and createBy!=''">
        and t.create_by=#{createBy}
      </if>
      <if test="operationDate!=null">
        and t.check_date=#{operationDate}
      </if>
    </where>
  </select>

  <resultMap id="JcabCountResultMap" type="com.railway.business.catenary.domain.vo.JcebCountVo">
    <result column="c" property="count"/>
    <result column="check_date" property="operationDate"/>
  </resultMap>

  <select id="getCountByType" resultMap="JcabCountResultMap">
    SELECT count(*) c, max(t.check_date) as check_date
    FROM bus_jcb_glkg t
    LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
    <where>
      t.del_flag='0'
      <if test="submitState!=null and submitState!=''">
        and t.submit_state <![CDATA[ >= ]]> #{submitState}
      </if>
      <if test="deptId!=null and deptId!=''">
        and v.dept_id=#{deptId}
      </if>
      <if test="stationId!=null and stationId!=''">
        and v.station_id=#{stationId}
      </if>
      <if test="pillarCode!=null and pillarCode!=''">
        and t.pillar_code=#{pillarCode}
      </if>
      <if test="operator!=null and operator!=''">
        and t.check_user like concat('%', #{operator}, '%')
      </if>
      <if test="createBy!=null and createBy!=''">
        and t.create_by=#{createBy}
      </if>
      <if test="operationDate!=null">
        and t.check_date=#{operationDate}
      </if>
    </where>
  </select>


</mapper>