|
|
@@ -10,6 +10,8 @@
|
|
|
<result property="serName" column="SER_NAME" jdbcType="VARCHAR"/>
|
|
|
<result property="statusCode" column="STATUS_CODE" jdbcType="VARCHAR"/>
|
|
|
<result property="statisNum" column="STATIS_NUM" jdbcType="INTEGER"/>
|
|
|
+ <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,
|
|
|
@@ -19,7 +21,6 @@
|
|
|
l.STATIS_NUM,
|
|
|
m.name as MD_NAME,
|
|
|
s.name as SER_NAME
|
|
|
-
|
|
|
from PT_SERVICE_LOG_STATIS l
|
|
|
left join md_model_info m on l.MD_ID = m.MDID
|
|
|
left join pt_service s on l.SER_ID = s.SRV_ID
|
|
|
@@ -39,13 +40,28 @@
|
|
|
</insert>
|
|
|
<update id="updatePtServiceLogStatis">
|
|
|
update PT_SERVICE_LOG_STATIS
|
|
|
- STATIS_NUM = #{statisNum,jdbcType=INTEGER},
|
|
|
- where
|
|
|
- STATIS_TM = #{statisTm,jdbcType=DATE}
|
|
|
+ set STATIS_NUM = #{statisNum,jdbcType=INTEGER},
|
|
|
+ EXEC_TM = #{execTm,jdbcType=BIGINT}
|
|
|
+ where STATIS_TM = #{statisTm,jdbcType=DATE}
|
|
|
and MD_ID = #{mdId,jdbcType=VARCHAR}
|
|
|
and SER_ID = #{serId,jdbcType=VARCHAR}
|
|
|
and STATUS_CODE = #{statusCode,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
+ <select id="getInfoPtServiceLogStatis" resultType="com.ruoyi.interfaces.domain.vo.PtServiceLogStatisVo">
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ l.SER_ID,
|
|
|
+ l.STATUS_CODE,
|
|
|
+ l.STATIS_NUM
|
|
|
+ from PT_SERVICE_LOG_STATIS l
|
|
|
+ <where>
|
|
|
+ and STATIS_TM = #{statisTm}
|
|
|
+ and l.MD_ID = #{mdId}
|
|
|
+ and l.SER_ID = #{serId}
|
|
|
+ and STATUS_CODE = #{statusCode}
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectPtServiceLogStatis" resultMap="PtServiceLogStatisMap">
|
|
|
<include refid="selectPtServiceLogStatis"/>
|
|
|
<where>
|
|
|
@@ -72,7 +88,6 @@
|
|
|
<if test="statisNum != null ">
|
|
|
and STATIS_NUM = #{statisNum}
|
|
|
</if>
|
|
|
-
|
|
|
</where>
|
|
|
ORDER BY STATIS_TM,MD_ID,SER_ID,STATUS_CODE
|
|
|
</select>
|
|
|
@@ -153,8 +168,6 @@
|
|
|
<where>
|
|
|
and m.name is not null
|
|
|
</where>
|
|
|
-
|
|
|
-
|
|
|
</select>
|
|
|
<select id="selectPtServiceLogStatisMonthMdList"
|
|
|
resultMap="PtServiceLogStatisMap">
|
|
|
@@ -197,7 +210,6 @@
|
|
|
</select>
|
|
|
<select id="selectPtServiceLogStatisYearMdList"
|
|
|
resultMap="PtServiceLogStatisMap">
|
|
|
-
|
|
|
select l.STATIS_TM,
|
|
|
l.MD_ID,
|
|
|
'' as SER_ID,
|
|
|
@@ -235,4 +247,27 @@
|
|
|
</where>
|
|
|
|
|
|
</select>
|
|
|
+ <select id="selectMdQuality" resultMap="PtServiceLogStatisMap">
|
|
|
+ SELECT m.mdid MD_ID, m.name as MD_NAME, d.STATIS_NUM, d.STATIS_NUM_TRUE
|
|
|
+ FROM md_model_info m
|
|
|
+ LEFT JOIN (SELECT md_id,
|
|
|
+ sum(statis_num) statis_num,
|
|
|
+ SUM(CASE WHEN status_code = '200' THEN statis_num ELSE 0 END) AS statis_num_true
|
|
|
+ FROM (SELECT md_id,
|
|
|
+ status_code,
|
|
|
+ sum(statis_num) statis_num,
|
|
|
+ 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')
|
|
|
+ GROUP BY md_id, status_code)
|
|
|
+ GROUP BY md_id) d ON m.mdid = d.MD_ID
|
|
|
+ <where>
|
|
|
+ <if test="devkind != null and devkind != ''">
|
|
|
+ and devkind = #{devkind}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY m.sort
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|