|
|
@@ -2,20 +2,27 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.interfaces.mapper.PtServiceLogStatisMapper">
|
|
|
|
|
|
- <resultMap type="com.ruoyi.interfaces.domain.PtServiceLogStatis" id="PtServiceLogStatisMap">
|
|
|
+ <resultMap type="com.ruoyi.interfaces.domain.vo.PtServiceLogStatisVo" id="PtServiceLogStatisMap">
|
|
|
<result property="statisTm" column="STATIS_TM" jdbcType="DATE"/>
|
|
|
<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="statisNum" column="STATIS_NUM" jdbcType="INTEGER"/>
|
|
|
</resultMap>
|
|
|
<sql id="selectPtServiceLogStatis">
|
|
|
- select STATIS_TM,
|
|
|
- MD_ID,
|
|
|
- SER_ID,
|
|
|
- STATUS_CODE,
|
|
|
- STATIS_NUM
|
|
|
- from PT_SERVICE_LOG_STATIS
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ l.SER_ID,
|
|
|
+ l.STATUS_CODE,
|
|
|
+ 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
|
|
|
</sql>
|
|
|
<insert id="insertPtServiceLogStatis">
|
|
|
insert into PT_SERVICE_LOG_STATIS
|
|
|
@@ -42,14 +49,22 @@
|
|
|
<select id="selectPtServiceLogStatis" resultMap="PtServiceLogStatisMap">
|
|
|
<include refid="selectPtServiceLogStatis"/>
|
|
|
<where>
|
|
|
+ and m.name is not null
|
|
|
+ and s.name is not null
|
|
|
<if test="statisTm != null ">
|
|
|
and STATIS_TM = #{statisTm}
|
|
|
</if>
|
|
|
+ <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 MD_ID = #{mdId}
|
|
|
+ and l.MD_ID = #{mdId}
|
|
|
</if>
|
|
|
<if test="serId != null and serId != ''">
|
|
|
- and SER_ID = #{serId}
|
|
|
+ and l.SER_ID = #{serId}
|
|
|
</if>
|
|
|
<if test="statusCode != null and statusCode != ''">
|
|
|
and STATUS_CODE = #{statusCode}
|
|
|
@@ -57,6 +72,48 @@
|
|
|
<if test="statisNum != null ">
|
|
|
and STATIS_NUM = #{statisNum}
|
|
|
</if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ ORDER BY STATIS_TM,MD_ID,SER_ID,STATUS_CODE
|
|
|
+ </select>
|
|
|
+ <select id="selectPtServiceLogStatisMonthList"
|
|
|
+ resultMap="PtServiceLogStatisMap">
|
|
|
+ select l.STATIS_TM,
|
|
|
+ l.MD_ID,
|
|
|
+ l.SER_ID,
|
|
|
+ l.STATUS_CODE,
|
|
|
+ l.STATIS_NUM,
|
|
|
+ m.name as MD_NAME,
|
|
|
+ s.name as SER_NAME
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ mmdd AS STATIS_TM ,MD_ID,SER_ID,STATUS_CODE,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,SER_ID,STATUS_CODE
|
|
|
+ ) 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
|
|
|
+ <where>
|
|
|
+ and m.name is not null
|
|
|
+ and s.name is not null
|
|
|
</where>
|
|
|
</select>
|
|
|
</mapper>
|