|
|
@@ -116,4 +116,123 @@
|
|
|
and s.name is not null
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <select id="selectPtServiceLogStatisMdList"
|
|
|
+ resultMap="PtServiceLogStatisMap">
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ '' as SER_ID,
|
|
|
+ '' as STATUS_CODE,
|
|
|
+ l.STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ '' as SER_NAME
|
|
|
+ from (
|
|
|
+ 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
|
|
|
+ left join md_model_info m on l.MD_ID = m.MDID
|
|
|
+ <where>
|
|
|
+ and m.name is not null
|
|
|
+ </where>
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="selectPtServiceLogStatisMonthMdList"
|
|
|
+ resultMap="PtServiceLogStatisMap">
|
|
|
+
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ '' as SER_ID,
|
|
|
+ '' as STATUS_CODE,
|
|
|
+ l.STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ '' as SER_NAME
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ mmdd AS STATIS_TM ,MD_ID,sum(statis_num) statis_num
|
|
|
+ FROM (
|
|
|
+ SELECT t.*,to_char(STATIS_TM,'yyyy-mm' ) || '-01' mmdd 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 mmdd,MD_ID
|
|
|
+ ) l
|
|
|
+ left join md_model_info m on l.MD_ID = m.MDID
|
|
|
+ <where>
|
|
|
+ and m.name is not null
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectPtServiceLogStatisYearMdList"
|
|
|
+ resultMap="PtServiceLogStatisMap">
|
|
|
+
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ '' as SER_ID,
|
|
|
+ '' as STATUS_CODE,
|
|
|
+ l.STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ '' as SER_NAME
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ mmdd AS STATIS_TM ,MD_ID,sum(statis_num) statis_num
|
|
|
+ FROM (
|
|
|
+ SELECT t.*,to_char(STATIS_TM,'yyyy' ) || '-01-01' mmdd 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 mmdd,MD_ID
|
|
|
+ ) l
|
|
|
+ left join md_model_info m on l.MD_ID = m.MDID
|
|
|
+ <where>
|
|
|
+ and m.name is not null
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
</mapper>
|