| | |
| | | <?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.yssh.mapper.XlsReportMapper"> |
| | | <select id="selectReportCount" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from xls_report |
| | | <where> |
| | | 1 = 1 |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 分页查询报告 --> |
| | | <select id="selectReportByPage" resultType="com.yssh.entity.xls.XlsReport"> |
| | | select * |
| | |
| | | and create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and end <= #{end} |
| | | and create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | order by create_time desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <!-- 根据ID查询报告 --> |
| | | <select id="selectById" resultType="com.yssh.entity.xls.XlsReport"> |
| | | select * |
| | | from xls_report |
| | | where id = #{id}; |
| | | </select> |
| | | |
| | | <!-- 报告是否存在 --> |
| | |
| | | |
| | | <!-- 查询日均值 --> |
| | | <select id="selectDayAvg" resultType="java.lang.Double"> |
| | | select ifnull(format(avg(value), 2), 0) |
| | | select ifnull(round(avg(value), 2), 0) |
| | | from yssh_qxsh |
| | | where time like #{time} and name = #{name}; |
| | | </select> |
| | | |
| | | <!-- 查询累计值 --> |
| | | <select id="selectAccumulate" resultType="java.lang.Double"> |
| | | select ifnull(format(avg(value), 2), 0) |
| | | select ifnull(round(avg(value), 2), 0) |
| | | from yssh_qxsh |
| | | where time between #{start} and #{end} and name = #{name}; |
| | | </select> |
| | | |
| | | <!-- 查询年累计值 --> |
| | | <select id="selectYearAccumulate" resultType="java.lang.Double"> |
| | | select ifnull(format(avg(value), 2), 0) |
| | | select ifnull(round(avg(value), 2), 0) |
| | | from yssh_qxsh |
| | | where time like #{time} and name = #{name}; |
| | | </select> |