|
|
@@ -13,7 +13,9 @@
|
|
|
<result property="statisNumTrue" column="STATIS_NUM_TRUE" jdbcType="INTEGER"/>
|
|
|
<result property="execTm" column="EXEC_TM" jdbcType="BIGINT"/>
|
|
|
</resultMap>
|
|
|
+
|
|
|
<sql id="selectPtServiceLogStatis">
|
|
|
+
|
|
|
select l.STATIS_TM,
|
|
|
l.MD_ID,
|
|
|
l.SER_ID,
|
|
|
@@ -270,12 +272,12 @@
|
|
|
</where>
|
|
|
ORDER BY m.sort
|
|
|
</select>
|
|
|
- <select id="selectMdEfficiency" resultMap="PtServiceLogStatisMap" >
|
|
|
+ <select id="selectMdEfficiency" resultMap="PtServiceLogStatisMap">
|
|
|
SELECT m.mdid MD_ID, m.name as MD_NAME, d.STATIS_NUM, d.EXEC_TM
|
|
|
FROM md_model_info m
|
|
|
LEFT JOIN (SELECT md_id,
|
|
|
sum(statis_num) statis_num,
|
|
|
- sum(exec_tm) exec_tm
|
|
|
+ sum(exec_tm) exec_tm
|
|
|
FROM PT_SERVICE_LOG_STATIS
|
|
|
WHERE STATIS_TM >= to_date(#{params.beginTime}, 'yyyy-mm-dd')
|
|
|
AND STATIS_TM <= to_date(#{params.endTime}, 'yyyy-mm-dd')
|
|
|
@@ -288,5 +290,103 @@
|
|
|
</where>
|
|
|
ORDER BY m.sort
|
|
|
</select>
|
|
|
+ <select id="selectPtServiceLogStatisStatusSum"
|
|
|
+ resultMap="PtServiceLogStatisMap">
|
|
|
+ select
|
|
|
+ null as STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ '' as SER_ID,
|
|
|
+ STATUS_CODE as STATUS_CODE,
|
|
|
+ l.STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ '' as SER_NAME
|
|
|
+ from md_model_info m left join(
|
|
|
+ SELECT
|
|
|
+ MD_ID,STATUS_CODE, sum(statis_num) statis_num
|
|
|
+ FROM (
|
|
|
+ SELECT t.* FROM PT_SERVICE_LOG_STATIS t
|
|
|
+ <where>
|
|
|
+ <if test="params.beginTime != null">
|
|
|
+ and STATIS_TM >= to_date(#{params.beginTime},'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null">
|
|
|
+ and STATIS_TM <= to_date(#{params.endTime},'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="mdId != null and mdId != ''">
|
|
|
+ and t.MD_ID = #{mdId}
|
|
|
+ </if>
|
|
|
+ <if test="serId != null and serId != ''">
|
|
|
+ and t.SER_ID = #{serId}
|
|
|
+ </if>
|
|
|
+ <if test="statusCode != null and statusCode != ''">
|
|
|
+ and STATUS_CODE = #{statusCode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) GROUP BY MD_ID ,STATUS_CODE
|
|
|
+ ) l
|
|
|
+ on l.MD_ID = m.MDID
|
|
|
+ <where>
|
|
|
+ and m.name is not null
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.interfaces.domain.vo.PtServiceLogStatisVo" id="PtServiceLogStatisLineChartMap">
|
|
|
+ <result property="mdId" column="MD_ID" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mdName" column="MD_NAME" jdbcType="VARCHAR"/>
|
|
|
+ <result property="serId" column="SER_ID" jdbcType="VARCHAR"/>
|
|
|
+ <result property="serName" column="SER_NAME" jdbcType="VARCHAR"/>
|
|
|
+ <result property="statusCode" column="STATUS_CODE" jdbcType="VARCHAR"/>
|
|
|
+ <result property="statisNumTrue" column="STATIS_NUM_TRUE" jdbcType="INTEGER"/>
|
|
|
+ <result property="execTm" column="EXEC_TM" jdbcType="BIGINT"/>
|
|
|
+ <collection property="lineCharts" ofType="com.ruoyi.interfaces.domain.vo.LineChart" resultMap="LineChartMap"/>
|
|
|
+ </resultMap>
|
|
|
+ <resultMap id="LineChartMap" type="com.ruoyi.interfaces.domain.vo.LineChart">
|
|
|
+ <result property="time" column="STATIS_TM" jdbcType="DATE"/>
|
|
|
+ <result property="num" column="STATIS_NUM" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="selectPtServiceLogStatisMdAllList"
|
|
|
+ resultMap="PtServiceLogStatisLineChartMap">
|
|
|
+
|
|
|
+ SELECT DAY_DATE AS STATIS_TM,
|
|
|
+ m.MDID AS MD_ID,
|
|
|
+ '' as SER_ID,
|
|
|
+ '' as STATUS_CODE,
|
|
|
+ case when l.STATIS_NUM is NULL THEN 0 ELSE l.STATIS_NUM end AS STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ '' as SER_NAME FROM (
|
|
|
+ SELECT * FROM (
|
|
|
+ SELECT to_date(#{params.beginTime},'yyyy-mm-dd') + LEVEL - 1 AS day_date
|
|
|
+ FROM DUAL
|
|
|
+ CONNECT BY LEVEL <= to_date(#{params.endTime},'yyyy-mm-dd') - to_date(#{params.beginTime},'yyyy-mm-dd') + 1
|
|
|
+ ORDER BY day_date
|
|
|
+ ) d LEFT JOIN md_model_info m ON 1=1
|
|
|
+ ) m left join(
|
|
|
+ SELECT
|
|
|
+ STATIS_TM ,MD_ID,sum(statis_num) statis_num
|
|
|
+ FROM (
|
|
|
+ SELECT t.* FROM PT_SERVICE_LOG_STATIS t
|
|
|
+ <where>
|
|
|
+ <if test="params.beginTime != null">
|
|
|
+ and STATIS_TM >= to_date(#{params.beginTime},'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="params.endTime != null">
|
|
|
+ and STATIS_TM <= to_date(#{params.endTime},'yyyy-mm-dd')
|
|
|
+ </if>
|
|
|
+ <if test="mdId != null and mdId != ''">
|
|
|
+ and t.MD_ID = #{mdId}
|
|
|
+ </if>
|
|
|
+ <if test="serId != null and serId != ''">
|
|
|
+ and t.SER_ID = #{serId}
|
|
|
+ </if>
|
|
|
+ <if test="statusCode != null and statusCode != ''">
|
|
|
+ and STATUS_CODE = #{statusCode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) GROUP BY STATIS_TM,MD_ID
|
|
|
+ ) l
|
|
|
+ on l.MD_ID = m.MDID AND m.DAY_DATE = l.STATIS_TM
|
|
|
+ WHERE m.name is not NULL
|
|
|
+ ORDER BY m.mdid,DAY_DATE
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|