| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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.daju.mix.dao.mapper.TBProposalMapper">
-
- <resultMap id="TBProposalMap" type="com.daju.mix.dao.entity.TBProposal"/>
- <resultMap id="AlarmCountDtoMap" type="com.daju.mix.dto.AlarmCountDto"/>
- <resultMap id="DbfDaysCountDtoMap" type="com.daju.mix.dto.DbfDaysCountDto"/>
- <resultMap id="ImprovmentSuggestDtoMap" type="com.daju.mix.dto.ImprovmentSuggestDto"/>
- <select id="selectAll" resultMap="TBProposalMap">
- select id,user,content from t_b_proposal
- </select>
- <!--查询 档案当日问题上报数量-->
- <select id="selectCountByArchivesId" resultType="int">
- select count(id)
- from t_b_proposal
- where DATEDIFF(now(),create_date) = 0
- and type = #{type}
- and archives_id = #{archivesId}
- </select>
- <!--查询 档案昨日日问题上报数量-->
- <select id="selectCountByArchivesIdYesterday" resultType="int">
- select count(id)
- from t_b_proposal
- where DATEDIFF(now(),create_date) = 1
- and type = #{type}
- and archives_id = #{archivesId}
- </select>
- <!-- 已处理问题量-->
- <select id="processedCount" resultType="int">
- select count(id) from t_b_proposal where state in (2,3,4) and type = #{type}
- </select>
- <!-- 中转点最近七日上报 已处理 数量列表-->
- <select id="dbfLastSevenDaysCounts" resultMap="DbfDaysCountDtoMap">
- select DATE_FORMAT(a.timeDay, '%Y-%m-%d') as date, ifnull(b.count, 0) as issueCount,ifnull(c.count, 0) as processedIssueCount
- from (SELECT curdate() as timeDay
- union all
- SELECT date_sub(curdate(), interval 1 day) as timeDay
- union all
- SELECT date_sub(curdate(), interval 2 day) as timeDay
- union all
- SELECT date_sub(curdate(), interval 3 day) as timeDay
- union all
- SELECT date_sub(curdate(), interval 4 day) as timeDay
- union all
- SELECT date_sub(curdate(), interval 5 day) as timeDay
- union all
- SELECT date_sub(curdate(), interval 6 day) as timeDay) a
- left join (select date(create_date) as time, count(*) count
- from t_b_proposal
- where type = 5
- and archives_id = #{archiveId}
- group by date(create_date)) b on a.timeDay = b.time
- left join (select date(b.create_date) as time, count(*) count
- from t_b_proposal b
- left join p_projecttask a on a.id = b.project_task_id
- where type = 5
- and archives_id = #{archiveId}
- and taskstatus is not null
- and taskstatus != 0
- group by date(create_date)) c on a.timeDay = c.time
- order by date
- </select>
- </mapper>
|