| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <?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.bi.mapper.ShowBdycMapper">
- <resultMap id="BaseResultMap" type="com.railway.business.bi.domain.ShowBdyc">
- <result column="id" property="id"/>
- <result column="found_date" property="foundDate"/>
- <result column="line_name" property="lineName"/>
- <result column="station_name" property="stationName"/>
- <result column="qxsbmc" property="qxsbmc"/>
- <result column="yxbh" property="yxbh"/>
- <result column="qxdj" property="qxdj"/>
- <result column="qxnr" property="qxnr"/>
- <result column="reason" property="reason"/>
- <result column="zrbm" property="zrbm"/>
- <result column="sjgq" property="sjgq"/>
- <result column="rectify_result" property="rectifyResult"/>
- <result column="rectify_way" property="rectifyWay"/>
- <result column="rectify_date" property="rectifyDate"/>
- <result column="counted" property="counted"/>
- <result column="plan_date" property="planDate"/>
- <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="file_id" property="fileId"/>
- <result column="del_flag" property="delFlag"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,
- found_date,
- line_name,
- station_name,
- qxsbmc,
- yxbh,
- qxdj,
- qxnr,
- reason,
- zrbm,
- sjgq,
- rectify_result,
- rectify_way,
- rectify_date,
- counted,
- plan_date,
- create_by,
- create_time,
- update_by,
- update_time,
- del_flag,
- file_id
- </sql>
- <insert id="insert" parameterType="com.railway.business.bi.domain.ShowBdyc">
- INSERT INTO show_bdyc
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test='null != foundDate'>
- found_date,
- </if>
- <if test='null != lineName'>
- line_name,
- </if>
- <if test='null != stationName'>
- station_name,
- </if>
- <if test='null != qxsbmc'>
- qxsbmc,
- </if>
- <if test='null != yxbh'>
- yxbh,
- </if>
- <if test='null != qxdj'>
- qxdj,
- </if>
- <if test='null != qxnr'>
- qxnr,
- </if>
- <if test='null != reason'>
- reason,
- </if>
- <if test='null != zrbm'>
- zrbm,
- </if>
- <if test='null != sjgq'>
- sjgq,
- </if>
- <if test='null != rectifyResult'>
- rectify_result,
- </if>
- <if test='null != rectifyWay'>
- rectify_way,
- </if>
- <if test='null != rectifyDate'>
- rectify_date,
- </if>
- <if test='null != counted'>
- counted,
- </if>
- <if test='null != planDate'>
- plan_date,
- </if>
- <if test='null != createBy'>
- create_by,
- </if>
- <if test='null != createTime'>
- create_time,
- </if>
- <if test='null != fileId'>
- file_id,
- </if>
- <if test='null != foundMode'>
- found_mode,
- </if>
- <if test='null != delFlag'>
- del_flag
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test='null != foundDate'>
- #{foundDate},
- </if>
- <if test='null != lineName'>
- #{lineName},
- </if>
- <if test='null != stationName'>
- #{stationName},
- </if>
- <if test='null != qxsbmc'>
- #{qxsbmc},
- </if>
- <if test='null != yxbh'>
- #{yxbh},
- </if>
- <if test='null != qxdj'>
- #{qxdj},
- </if>
- <if test='null != qxnr'>
- #{qxnr},
- </if>
- <if test='null != reason'>
- #{reason},
- </if>
- <if test='null != zrbm'>
- #{zrbm},
- </if>
- <if test='null != sjgq'>
- #{sjgq},
- </if>
- <if test='null != rectifyResult'>
- #{rectifyResult},
- </if>
- <if test='null != rectifyWay'>
- #{rectifyWay},
- </if>
- <if test='null != rectifyDate'>
- #{rectifyDate},
- </if>
- <if test='null != counted'>
- #{counted},
- </if>
- <if test='null != planDate'>
- #{planDate},
- </if>
- <if test='null != createBy'>
- #{createBy},
- </if>
- <if test='null != createTime'>
- #{createTime},
- </if>
- <if test='null != fileId'>
- #{fileId},
- </if>
- <if test='null != foundMode'>
- #{foundMode},
- </if>
- <if test='null != delFlag'>
- #{delFlag}
- </if>
- </trim>
- </insert>
- <delete id="delete">
- UPDATE show_bdyc
- set del_flag='1'
- WHERE id = #{id}
- </delete>
- <update id="update" parameterType="com.railway.business.bi.domain.ShowBdyc">
- UPDATE show_bdyc
- <set>
- <if test='null != foundDate'>found_date = #{foundDate},</if>
- <if test='null != lineName'>line_name = #{lineName},</if>
- <if test='null != stationName'>station_name = #{stationName},</if>
- <if test='null != qxsbmc'>qxsbmc = #{qxsbmc},</if>
- <if test='null != yxbh'>yxbh = #{yxbh},</if>
- <if test='null != qxdj'>qxdj = #{qxdj},</if>
- <if test='null != qxnr'>qxnr = #{qxnr},</if>
- <if test='null != reason'>reason = #{reason},</if>
- <if test='null != zrbm'>zrbm = #{zrbm},</if>
- <if test='null != sjgq'>sjgq = #{sjgq},</if>
- <if test='null != rectifyResult'>rectify_result = #{rectifyResult},</if>
- <if test='null != rectifyWay'>rectify_way = #{rectifyWay},</if>
- <if test='null != rectifyDate'>rectify_date = #{rectifyDate},</if>
- <if test='null != counted'>counted = #{counted},</if>
- <if test='null != planDate'>plan_date = #{planDate},</if>
- <if test='null != updateBy'>update_by = #{updateBy},</if>
- <if test='null != updateTime'>update_time = #{updateTime},</if>
- <if test='null != fileId'>file_id = #{fileId},</if>
- <if test='null != delFlag'>del_flag = #{delFlag}</if>
- </set>
- WHERE id = #{id}
- </update>
- <select id="getInfo" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM show_bdyc
- WHERE del_flag='0' and id = #{id}
- </select>
- <select id="getList" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM show_bdyc
- <where>
- del_flag='0'
- and file_id = (select max(id) from show_file where data_type='yctj' and imp_result = '1')
- <if test="gravity!=null and gravity!=''">
- and qxdj=(select dict_label from sys_dict_data where dict_type='dlycyzx' and
- dict_value=#{gravity})
- </if>
- <if test="ssgq!=null and ssgq!=''">
- and sjgq=(select dict_label from sys_dict_data where dict_type='dlyc_sygq' and
- dict_value=#{ssgq})
- </if>
- <if test="lineName!=null and lineName!=''">
- and line_name like concat('%', #{lineName}, '%')
- </if>
- <if test="zrbm!=null and zrbm!=''">
- and zrbm like concat('%', #{zrbm}, '%')
- </if>
- <if test="rectifyResult!=null and rectifyResult!=''">
- and rectify_result =
- (select dict_label from sys_dict_data where dict_type='bdyc_clqk' and
- dict_value=#{rectifyResult})
- </if>
- <if test="foundMode!=null and foundMode!=''">
- and found_mode=#{foundMode}
- </if>
- </where>
- </select>
- <select id="getLineList" resultType="java.lang.String">
- SELECT distinct line_name
- FROM show_bdyc
- <where>
- del_flag='0'
- and file_id = (select max(id) from show_file where data_type='yctj' and imp_result = '1')
- and found_mode=#{foundMode}
- </where>
- </select>
- <select id="totalByDay" resultType="com.railway.business.bi.domain.dto.DlycDTO">
- select t1.dict_label as gq,
- t1.dict_value as gqCode,
- sum(yj) as dj1,
- sum(ej) as dj2,
- sum(sj) as dj3
- from (select sjgq,
- case when qxdj = '一级' then 1 else 0 end as yj,
- case when qxdj = '二级' then 1 else 0 end as ej,
- case when qxdj = '三级' then 1 else 0 end as sj
- from show_bdyc
- where del_flag = '0'
- <!-- and found_date = #{date} -->
- and rectify_result='未处理'
- and file_id =
- (select max(id) from show_file where data_type = 'yctj' and imp_result = '1')
- and sjgq is not null) x
- right join sys_dict_data t1 on x.sjgq = t1.dict_label
- where t1.dict_type = 'dlyc_sygq'
- group by t1.dict_label
- </select>
- <resultMap id="TotalResultMap" type="com.railway.business.bi.domain.vo.YcxxTotalVO">
- <result column="gravity" property="gravity"/>
- <result column="data" property="data"/>
- </resultMap>
- <select id="getTotal" resultMap="TotalResultMap">
- SELECT qxdj gravity, count(*) data
- FROM show_bdyc
- where del_flag = '0'
- and rectify_result='未处理'
- and file_id = (select max(id) from show_file where data_type = 'yctj' and imp_result = '1')
- group by qxdj;
- </select>
- </mapper>
|