| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449 |
- <?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.BusJcbDmcgyqMapper">
- <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcbDmcgyq">
- <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="fenxiang" property="fenxiang"/>
- <result column="xingbie" property="xingbie"/>
- <result column="xingbie_text" property="xingbieText"/>
- <result column="pillar_area" property="pillarArea"/>
- <result column="tianqi" property="tianqi"/>
- <result column="temperature" property="temperature"/>
- <result column="check_date" property="checkDate"/>
- <result column="dgqwg_azlg" property="dgqwgAzlg"/>
- <result column="dgqwg_wzws" property="dgqwgWzws"/>
- <result column="dgqwg_bmqj" property="dgqwgBmqj"/>
- <result column="dgqwg_azlg_gzms" property="dgqwgAzlgGzms"/>
- <result column="dgqwg_wzws_gzms" property="dgqwgWzwsGzms"/>
- <result column="dgqwg_bmqj_gzms" property="dgqwgBmqjGzms"/>
- <result column="bspwg_bsqx" property="bspwgBsqx"/>
- <result column="bspwg_bsqx_gzms" property="bspwgBsqxGzms"/>
- <result column="bspwg_azlg" property="bspwgAzlg"/>
- <result column="bspwg_azlg_gzms" property="bspwgAzlgGzms"/>
- <result column="dgqcl_g1" property="dgqclG1"/>
- <result column="dgqcl_g2" property="dgqclG2"/>
- <result column="dgqcl_g3" property="dgqclG3"/>
- <result column="dgqcl_g4" property="dgqclG4"/>
- <result column="sbzt" property="sbzt"/>
- <result column="check_user" property="checkUser"/>
- <result column="confirm_user" property="confirmUser"/>
- <result column="czwt" property="czwt"/>
- <result column="submit_state" property="submitState"/>
- <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="user_id" property="userId"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,
- v.dept_id,
- v.dept_name,
- v.station_name as station_name,
- t.station_id,
- t.fenxiang,
- t.xingbie,
- t.pillar_area,
- t.tianqi,
- t.temperature,
- t.check_date,
- t.dgqwg_azlg,
- t.dgqwg_wzws,
- t.dgqwg_bmqj,
- t.dgqwg_azlg_gzms,
- t.dgqwg_wzws_gzms,
- t.dgqwg_bmqj_gzms,
- t.bspwg_bsqx,
- t.bspwg_bsqx_gzms,
- t.bspwg_azlg,
- t.bspwg_azlg_gzms,
- t.dgqcl_g1,
- t.dgqcl_g2,
- t.dgqcl_g3,
- t.dgqcl_g4,
- t.sbzt,
- t.check_user,
- t.confirm_user,
- t.czwt,
- t.submit_state,
- t.create_by,
- t.create_time,
- t.update_by,
- t.update_time,
- t.user_id
- </sql>
- <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
- INSERT INTO bus_jcb_dmcgyq
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test='null != stationId'>
- station_id,
- </if>
- <if test='null != fenxiang'>
- fenxiang,
- </if>
- <if test='null != xingbie'>
- xingbie,
- </if>
- <if test='null != pillarArea'>
- pillar_area,
- </if>
- <if test='null != tianqi'>
- tianqi,
- </if>
- <if test='null != temperature'>
- temperature,
- </if>
- <if test='null != checkDate'>
- check_date,
- </if>
- <if test='null != dgqwgAzlg'>
- dgqwg_azlg,
- </if>
- <if test='null != dgqwgWzws'>
- dgqwg_wzws,
- </if>
- <if test='null != dgqwgBmqj'>
- dgqwg_bmqj,
- </if>
- <if test='null != dgqwgAzlgGzms'>
- dgqwg_azlg_gzms,
- </if>
- <if test='null != dgqwgWzwsGzms'>
- dgqwg_wzws_gzms,
- </if>
- <if test='null != dgqwgBmqjGzms'>
- dgqwg_bmqj_gzms,
- </if>
- <if test='null != bspwgBsqx'>
- bspwg_bsqx,
- </if>
- <if test='null != bspwgBsqxGzms'>
- bspwg_bsqx_gzms,
- </if>
- <if test='null != bspwgAzlg'>
- bspwg_azlg,
- </if>
- <if test='null != bspwgAzlgGzms'>
- bspwg_azlg_gzms,
- </if>
- <if test='null != dgqclG1'>
- dgqcl_g1,
- </if>
- <if test='null != dgqclG2'>
- dgqcl_g2,
- </if>
- <if test='null != dgqclG3'>
- dgqcl_g3,
- </if>
- <if test='null != dgqclG4'>
- dgqcl_g4,
- </if>
- <if test='null != sbzt'>
- sbzt,
- </if>
- <if test='null != checkUser'>
- check_user,
- </if>
- <if test='null != czwt'>
- czwt,
- </if>
- <if test='null != submitState'>
- submit_state,
- </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 != userId'>
- user_id
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test='null != stationId'>
- #{stationId},
- </if>
- <if test='null != fenxiang'>
- #{fenxiang},
- </if>
- <if test='null != xingbie'>
- #{xingbie},
- </if>
- <if test='null != pillarArea'>
- #{pillarArea},
- </if>
- <if test='null != tianqi'>
- #{tianqi},
- </if>
- <if test='null != temperature'>
- #{temperature},
- </if>
- <if test='null != checkDate'>
- #{checkDate},
- </if>
- <if test='null != dgqwgAzlg'>
- #{dgqwgAzlg},
- </if>
- <if test='null != dgqwgWzws'>
- #{dgqwgWzws},
- </if>
- <if test='null != dgqwgBmqj'>
- #{dgqwgBmqj},
- </if>
- <if test='null != dgqwgAzlgGzms'>
- #{dgqwgAzlgGzms},
- </if>
- <if test='null != dgqwgWzwsGzms'>
- #{dgqwgWzwsGzms},
- </if>
- <if test='null != dgqwgBmqjGzms'>
- #{dgqwgBmqjGzms},
- </if>
- <if test='null != bspwgBsqx'>
- #{bspwgBsqx},
- </if>
- <if test='null != bspwgBsqxGzms'>
- #{bspwgBsqxGzms},
- </if>
- <if test='null != bspwgAzlg'>
- #{bspwgAzlg},
- </if>
- <if test='null != bspwgAzlgGzms'>
- #{bspwgAzlgGzms},
- </if>
- <if test='null != dgqclG1'>
- #{dgqclG1},
- </if>
- <if test='null != dgqclG2'>
- #{dgqclG2},
- </if>
- <if test='null != dgqclG3'>
- #{dgqclG3},
- </if>
- <if test='null != dgqclG4'>
- #{dgqclG4},
- </if>
- <if test='null != sbzt'>
- #{sbzt},
- </if>
- <if test='null != checkUser'>
- #{checkUser},
- </if>
- <if test='null != czwt'>
- #{czwt},
- </if>
- <if test='null != submitState'>
- #{submitState},
- </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 != userId'>
- #{userId}
- </if>
- </trim>
- </insert>
- <delete id="delete">
- UPDATE bus_jcb_dmcgyq
- set del_flag='1'
- WHERE id = #{id}
- </delete>
- <update id="update" parameterType="com.railway.business.catenary.domain.BusJcbDmcgyq">
- UPDATE bus_jcb_dmcgyq
- <set>
- <if test='null != stationId'>station_id = #{stationId},</if>
- <if test='null != fenxiang'>fenxiang = #{fenxiang},</if>
- <if test='null != xingbie'>xingbie = #{xingbie},</if>
- <if test='null != pillarArea'>pillar_area = #{pillarArea},</if>
- <if test='null != tianqi'>tianqi = #{tianqi},</if>
- <if test='null != temperature'>temperature = #{temperature},</if>
- <if test='null != checkDate'>check_date = #{checkDate},</if>
- <if test='null != dgqwgAzlg'>dgqwg_azlg = #{dgqwgAzlg},</if>
- <if test='null != dgqwgWzws'>dgqwg_wzws = #{dgqwgWzws},</if>
- <if test='null != dgqwgBmqj'>dgqwg_bmqj = #{dgqwgBmqj},</if>
- <if test='null != dgqwgAzlgGzms'>dgqwg_azlg_gzms = #{dgqwgAzlgGzms},</if>
- <if test='null != dgqwgWzwsGzms'>dgqwg_wzws_gzms = #{dgqwgWzwsGzms},</if>
- <if test='null != dgqwgBmqjGzms'>dgqwg_bmqj_gzms = #{dgqwgBmqjGzms},</if>
- <if test='null != bspwgBsqx'>bspwg_bsqx = #{bspwgBsqx},</if>
- <if test='null != bspwgBsqxGzms'>bspwg_bsqx_gzms = #{bspwgBsqxGzms},</if>
- <if test='null != bspwgAzlg'>bspwg_azlg = #{bspwgAzlg},</if>
- <if test='null != bspwgAzlgGzms'>bspwg_azlg_gzms = #{bspwgAzlgGzms},</if>
- <if test='null != dgqclG1'>dgqcl_g1 = #{dgqclG1},</if>
- <if test='null != dgqclG2'>dgqcl_g2 = #{dgqclG2},</if>
- <if test='null != dgqclG3'>dgqcl_g3 = #{dgqclG3},</if>
- <if test='null != dgqclG4'>dgqcl_g4 = #{dgqclG4},</if>
- <if test='null != sbzt'>sbzt = #{sbzt},</if>
- <if test='null != checkUser'>check_user = #{checkUser},</if>
- <if test='null != czwt'>czwt = #{czwt},</if>
- <if test='null != submitState'>submit_state = #{submitState},</if>
- <if test='null != updateBy'>update_by = #{updateBy},</if>
- <if test='null != updateTime'>update_time = #{updateTime},</if>
- <if test='null != userId'>user_id = #{userId}</if>
- </set>
- WHERE id = #{id}
- </update>
- <select id="getInfo" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
- FROM bus_jcb_dmcgyq t
- LEFT JOIN v_station v on t.station_id = v.dept_station_id
- LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
- WHERE t.del_flag='0' and t.id = #{id}
- </select>
- <select id="getLastRecord" resultMap="BaseResultMap">
- SELECT
- a.DGQCL_G1, a.DGQCL_G2, a.DGQCL_G3, a.DGQCL_G4
- FROM bus_jcb_dmcgyq a,
- (
- select max(update_time) as lastTime
- from bus_jcb_dmcgyq
- WHERE user_id = #{user_id}
- and submit_state != '0'
- ) b
- WHERE a.update_time = b.lastTime
- </select>
- <select id="getList" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
- FROM bus_jcb_dmcgyq t
- LEFT JOIN v_station v on t.station_id = v.dept_station_id
- LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
- <where>
- t.del_flag='0'
- <if test="stationId!=null and stationId!=''">
- and t.station_id=#{stationId}
- </if>
- <if test="fenxiang!=null and fenxiang!=''">
- and t.fenxiang=#{fenxiang}
- </if>
- <if test="xingbie!=null and xingbie!=''">
- and t.xingbie=#{xingbie}
- </if>
- <if test="pillarArea!=null and pillarArea!=''">
- and t.pillar_area=#{pillarArea}
- </if>
- <if test="tianqi!=null and tianqi!=''">
- and t.tianqi=#{tianqi}
- </if>
- <if test="temperature!=null and temperature!=''">
- and t.temperature=#{temperature}
- </if>
- <if test="checkDate!=null and checkDate!=''">
- and t.check_date=#{checkDate}
- </if>
- <if test="dgqwgAzlg!=null and dgqwgAzlg!=''">
- and t.dgqwg_azlg=#{dgqwgAzlg}
- </if>
- <if test="dgqwgWzws!=null and dgqwgWzws!=''">
- and t.dgqwg_wzws=#{dgqwgWzws}
- </if>
- <if test="dgqwgBmqj!=null and dgqwgBmqj!=''">
- and t.dgqwg_bmqj=#{dgqwgBmqj}
- </if>
- <if test="dgqwgAzlgGzms!=null and dgqwgAzlgGzms!=''">
- and t.dgqwg_azlg_gzms=#{dgqwgAzlgGzms}
- </if>
- <if test="dgqwgWzwsGzms!=null and dgqwgWzwsGzms!=''">
- and t.dgqwg_wzws_gzms=#{dgqwgWzwsGzms}
- </if>
- <if test="dgqwgBmqjGzms!=null and dgqwgBmqjGzms!=''">
- and t.dgqwg_bmqj_gzms=#{dgqwgBmqjGzms}
- </if>
- <if test="bspwgBsqx!=null and bspwgBsqx!=''">
- and t.bspwg_bsqx=#{bspwgBsqx}
- </if>
- <if test="bspwgBsqxGzms!=null and bspwgBsqxGzms!=''">
- and t.bspwg_bsqx_gzms=#{bspwgBsqxGzms}
- </if>
- <if test="bspwgAzlg!=null and bspwgAzlg!=''">
- and t.bspwg_azlg=#{bspwgAzlg}
- </if>
- <if test="bspwgAzlgGzms!=null and bspwgAzlgGzms!=''">
- and t.bspwg_azlg_gzms=#{bspwgAzlgGzms}
- </if>
- <if test="dgqclG1!=null and dgqclG1!=''">
- and t.dgqcl_g1=#{dgqclG1}
- </if>
- <if test="dgqclG2!=null and dgqclG2!=''">
- and t.dgqcl_g2=#{dgqclG2}
- </if>
- <if test="dgqclG3!=null and dgqclG3!=''">
- and t.dgqcl_g3=#{dgqclG3}
- </if>
- <if test="dgqclG4!=null and dgqclG4!=''">
- and t.dgqcl_g4=#{dgqclG4}
- </if>
- <if test="sbzt!=null and sbzt!=''">
- and t.sbzt=#{sbzt}
- </if>
- <if test="checkUser!=null and checkUser!=''">
- and t.check_user=#{checkUser}
- </if>
- <if test="czwt!=null and czwt!=''">
- and t.czwt=#{czwt}
- </if>
- <if test="submitState!=null and submitState!=''">
- and t.submit_state=#{submitState}
- </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>
- <if test="userId!=null and userId!=''">
- and t.user_id=#{userId}
- </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>
- </mapper>
|