<?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="org.jeecg.modules.mdc.mapper.MdcDownTimeMapper">
|
|
<!--分页列表-->
|
<select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcDownTime">
|
SELECT
|
*
|
FROM
|
mdc_down_time
|
<where>
|
<if test="mdcDownTimeVo.equipmentId != null and mdcDownTimeVo.equipmentId != ''">
|
AND equipment_id = #{ mdcDownTimeVo.equipmentId }
|
</if>
|
<if test="mdcDownTimeVo.startTime != null and mdcDownTimeVo.startTime != ''">
|
AND the_date >= #{ mdcDownTimeVo.startTime }
|
</if>
|
<if test="mdcDownTimeVo.endTime != null and mdcDownTimeVo.endTime != ''">
|
AND the_date <= #{mdcDownTimeVo.endTime }
|
</if>
|
<if test="mdcDownTimeVo.equipmentIdList != null and mdcDownTimeVo.equipmentIdList.size() > 0 ">
|
AND equipment_id IN
|
<foreach collection="mdcDownTimeVo.equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
</if>
|
</where>
|
ORDER BY the_date DESC, equipment_id ASC
|
</select>
|
|
<!--查询当月总故障停机时间-->
|
<select id="findTotalDownLong" resultType="java.math.BigDecimal">
|
SELECT
|
SUM(down_long)
|
FROM
|
mdc_down_time
|
WHERE
|
the_date LIKE CONCAT(#{month}, '%')
|
</select>
|
|
<!--查询当月总故障停机次数-->
|
<select id="findTotalDownCount" resultType="java.lang.Integer">
|
SELECT
|
COUNT(down_long)
|
FROM
|
mdc_down_time
|
WHERE
|
the_date LIKE CONCAT(#{month}, '%')
|
</select>
|
</mapper>
|