| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?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.ruoyi.interfaces.mapper.PtServiceLogStatisMapper">
- <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 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
- (STATIS_TM,
- MD_ID,
- SER_ID,
- STATUS_CODE,
- STATIS_NUM)
- values (#{statisTm,jdbcType=DATE},
- #{mdId,jdbcType=VARCHAR},
- #{serId,jdbcType=VARCHAR},
- #{statusCode,jdbcType=VARCHAR},
- #{statisNum,jdbcType=INTEGER})
- </insert>
- <update id="updatePtServiceLogStatis">
- update PT_SERVICE_LOG_STATIS
- STATIS_NUM = #{statisNum,jdbcType=INTEGER},
- 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="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 l.MD_ID = #{mdId}
- </if>
- <if test="serId != null and serId != ''">
- and l.SER_ID = #{serId}
- </if>
- <if test="statusCode != null and statusCode != ''">
- and STATUS_CODE = #{statusCode}
- </if>
- <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>
|