| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- <?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.ShowYdtsMapper">
- <resultMap id="BaseResultMap" type="com.railway.business.bi.domain.ShowYdts">
- <result column="id" property="id"/>
- <result column="branch_name" property="branchName"/>
- <result column="dept_name" property="deptName"/>
- <result column="line_sddj" property="lineSddj"/>
- <result column="line_name" property="lineName"/>
- <result column="station_name" property="stationName"/>
- <result column="line_xz" property="lineXz"/>
- <result column="substation_name" property="substationName"/>
- <result column="switch_high" property="switchHigh"/>
- <result column="switch_low" property="switchLow"/>
- <result column="last_year" property="lastYear"/>
- <result column="plan_month" property="planMonth"/>
- <result column="overdue_reminder" property="overdueReminder"/>
- <result column="completion_date" property="completionDate"/>
- <result column="jhtzjy" property="jhtzjy"/>
- <result column="overdue_reason" property="overdueReason"/>
- <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,
- branch_name,
- dept_name,
- line_sddj,
- line_name,
- station_name,
- line_xz,
- substation_name,
- switch_high,
- switch_low,
- last_year,
- plan_month,
- overdue_reminder,
- completion_date,
- jhtzjy,
- overdue_reason,
- create_by,
- create_time,
- update_by,
- update_time,
- del_flag,
- file_id
- </sql>
- <insert id="insert" parameterType="com.railway.business.bi.domain.ShowYdts">
- INSERT INTO show_ydts
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test='null != branchName'>
- branch_name,
- </if>
- <if test='null != deptName'>
- dept_name,
- </if>
- <if test='null != lineSddj'>
- line_sddj,
- </if>
- <if test='null != lineName'>
- line_name,
- </if>
- <if test='null != stationName'>
- station_name,
- </if>
- <if test='null != lineXz'>
- line_xz,
- </if>
- <if test='null != substationName'>
- substation_name,
- </if>
- <if test='null != switchHigh'>
- switch_high,
- </if>
- <if test='null != switchLow'>
- switch_low,
- </if>
- <if test='null != lastYear'>
- last_year,
- </if>
- <if test='null != planMonth'>
- plan_month,
- </if>
- <if test='null != overdueReminder'>
- overdue_reminder,
- </if>
- <if test='null != completionDate'>
- completion_date,
- </if>
- <if test='null != jhtzjy'>
- jhtzjy,
- </if>
- <if test='null != overdueReason'>
- overdue_reason,
- </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 != delFlag'>
- del_flag
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test='null != branchName'>
- #{branchName},
- </if>
- <if test='null != deptName'>
- #{deptName},
- </if>
- <if test='null != lineSddj'>
- #{lineSddj},
- </if>
- <if test='null != lineName'>
- #{lineName},
- </if>
- <if test='null != stationName'>
- #{stationName},
- </if>
- <if test='null != lineXz'>
- #{lineXz},
- </if>
- <if test='null != substationName'>
- #{substationName},
- </if>
- <if test='null != switchHigh'>
- #{switchHigh},
- </if>
- <if test='null != switchLow'>
- #{switchLow},
- </if>
- <if test='null != lastYear'>
- #{lastYear},
- </if>
- <if test='null != planMonth'>
- #{planMonth},
- </if>
- <if test='null != overdueReminder'>
- #{overdueReminder},
- </if>
- <if test='null != completionDate'>
- #{completionDate},
- </if>
- <if test='null != jhtzjy'>
- #{jhtzjy},
- </if>
- <if test='null != overdueReason'>
- #{overdueReason},
- </if>
- <if test='null != createBy'>
- #{createBy},
- </if>
- <if test='null != createTime'>
- #{createTime},
- </if>
- <if test='null != fileId'>
- #{fileId},
- </if>
- <if test='null != delFlag'>
- #{delFlag}
- </if>
- </trim>
- </insert>
- <delete id="delete">
- UPDATE show_ydts
- set del_flag='1'
- WHERE id = #{id}
- </delete>
- <update id="update" parameterType="com.railway.business.bi.domain.ShowYdts">
- UPDATE show_ydts
- <set>
- <if test='null != branchName'>branch_name = #{branchName},</if>
- <if test='null != deptName'>dept_name = #{deptName},</if>
- <if test='null != lineSddj'>line_sddj = #{lineSddj},</if>
- <if test='null != lineName'>line_name = #{lineName},</if>
- <if test='null != stationName'>station_name = #{stationName},</if>
- <if test='null != lineXz'>line_xz = #{lineXz},</if>
- <if test='null != substationName'>substation_name = #{substationName},</if>
- <if test='null != switchHigh'>switch_high = #{switchHigh},</if>
- <if test='null != switchLow'>switch_low = #{switchLow},</if>
- <if test='null != lastYear'>last_year = #{lastYear},</if>
- <if test='null != planMonth'>plan_month = #{planMonth},</if>
- <if test='null != overdueReminder'>overdue_reminder = #{overdueReminder},</if>
- <if test='null != completionDate'>completion_date = #{completionDate},</if>
- <if test='null != jhtzjy'>jhtzjy = #{jhtzjy},</if>
- <if test='null != overdueReason'>overdue_reason = #{overdueReason},</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_ydts
- WHERE del_flag='0' and id = #{id}
- </select>
- <select id="getList" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM show_ydts
- <where>
- del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- <if test="lineName!=null and lineName!=''">
- and line_name like concat('%', #{lineName}, '%')
- </if>
- <if test="planMonth!=null and planMonth!=''">
- and plan_month like concat('%', #{planMonth})
- </if>
- </where>
- </select>
- <select id="getLineList" resultType="java.lang.String">
- SELECT distinct line_name
- FROM show_ydts
- <where>
- del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- </where>
- </select>
- <resultMap id="TotalResultMap" type="com.railway.business.bi.domain.vo.QuarterTotalVO">
- <result column="plan1" property="plan1"/>
- <result column="plan2" property="plan2"/>
- <result column="plan3" property="plan3"/>
- <result column="plan4" property="plan4"/>
- <result column="actual1" property="actual1"/>
- <result column="actual2" property="actual2"/>
- <result column="actual3" property="actual3"/>
- <result column="actual4" property="actual4"/>
- </resultMap>
- <select id="getYdtsTotal" resultMap="TotalResultMap">
- select sum(plan1) as plan1, sum(plan2) as plan2, sum(plan3) as plan3, sum(plan4) as plan4,
- sum(actual1) as actual1, sum(actual2) as actual2, sum(actual3) as actual3, sum(actual4) as actual4
- from(
- select
- case when plan_month>=1 and plan_month <![CDATA[<=]]> 3 then 1 else 0 end as plan1,
- case when plan_month>=4 and plan_month <![CDATA[<=]]> 6 then 1 else 0 end as plan2,
- case when plan_month>=7 and plan_month <![CDATA[<=]]> 9 then 1 else 0 end as plan3,
- case when plan_month>=10 and plan_month <![CDATA[<=]]> 12 then 1 else 0 end as plan4,
- case when QUARTER(completion_date)=1 then 1 else 0 end as actual1,
- case when QUARTER(completion_date)=2 then 1 else 0 end as actual2,
- case when QUARTER(completion_date)=3 then 1 else 0 end as actual3,
- case when QUARTER(completion_date)=4 then 1 else 0 end as actual4
- from show_ydts
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- ) a
- </select>
- <resultMap id="SingleTotalResultMap" type="com.railway.business.bi.domain.vo.SingleTotalVO">
- <result column="plan" property="plan"/>
- <result column="actual" property="actual"/>
- </resultMap>
- <select id="getYdtsTotalByDate" resultMap="SingleTotalResultMap">
- select sum(plan) as plan,
- sum(actual) as actual
- from(
- select
- case when plan_month = #{month} then 1 else 0 end as plan,
- case when completion_date>=#{startDate}
- and completion_date <![CDATA[<=]]> #{endDate} then 1 else 0 end as actual
- from show_ydts
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- ) a
- </select>
- <select id="countUndone" resultType="java.lang.Integer">
- select count(*)
- from show_ydts
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and plan_month = #{month} and (completion_date is null or completion_date = '')
- </select>
- <select id="countByywc" resultType="java.lang.Integer">
- select count(*)
- from show_gsd
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and plan_month = #{month} and completion_date is not null and completion_date != '';
- </select>
- <select id="countBywwc" resultType="java.lang.Integer">
- select count(*)
- from show_gsd
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and plan_month = #{month} and (completion_date is null or completion_date = '')
- </select>
- <select id="countXyjhwc" resultType="java.lang.Integer">
- select count(*)
- from show_gsd
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and plan_month = #{month}
- </select>
- <select id="countNdsys" resultType="java.lang.Integer">
- select count(*)
- from show_gsd
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and (completion_date is null or completion_date = '')
- </select>
- <select id="listWwcmx" resultType="java.lang.String">
- select substation_name
- from show_gsd
- where del_flag='0'
- and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
- and plan_month = #{month} and (completion_date is null or completion_date = '')
- </select>
- </mapper>
|