15 changed files with 1669 additions and 2 deletions
@ -0,0 +1,65 @@ |
|||
package com.ccsens.carbasics.api; |
|||
|
|||
|
|||
|
|||
import com.ccsens.carbasics.bean.dto.StatisticsDto; |
|||
import com.ccsens.carbasics.bean.vo.QuestionnaireVo; |
|||
import com.ccsens.carbasics.bean.vo.StatisticsVo; |
|||
import com.ccsens.carbasics.service.IDataStatisticsService; |
|||
import com.ccsens.cloudutil.annotation.MustLogin; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.util.bean.dto.QueryDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
@Api(tags = "问卷数据统计相关") |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("/statistics") |
|||
public class DataStatisticsController { |
|||
|
|||
@Resource |
|||
private IDataStatisticsService dataStatisticsService; |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "静脉溶栓率统计", notes = "") |
|||
@RequestMapping(value = "/jmrs", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<StatisticsVo.JmrsUpResult> statisticsJmrs(@ApiParam @Validated @RequestBody QueryDto params) throws Exception{ |
|||
log.info("静脉溶栓率统计开始{}",params); |
|||
StatisticsVo.JmrsUpResult result = dataStatisticsService.statisticsJmrs(params.getUserId()); |
|||
log.info("静脉溶栓率统计结束:{}",result); |
|||
return JsonResponse.newInstance().ok(result); |
|||
} |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "静脉溶栓达标率统计", notes = "") |
|||
@RequestMapping(value = "/standards", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<StatisticsVo.StandardsResult> queryStandards(@ApiParam @Validated @RequestBody QueryDto<StatisticsDto.QueryStandards> params) throws Exception{ |
|||
log.info("静脉溶栓达标率统计开始{}",params); |
|||
StatisticsVo.StandardsResult result = dataStatisticsService.queryStandards(params.getParam(),params.getUserId()); |
|||
log.info("静脉溶栓达标率统计结束:{}",result); |
|||
return JsonResponse.newInstance().ok(result); |
|||
} |
|||
|
|||
@MustLogin |
|||
@ApiOperation(value = "市或地区静脉溶率统计", notes = "") |
|||
@RequestMapping(value = "/data", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<StatisticsVo.AreaResult> queryData(@ApiParam @Validated @RequestBody QueryDto<StatisticsDto.QueryStandards> params) throws Exception{ |
|||
log.info("市或地区静脉溶率统计开始{}",params); |
|||
List<StatisticsVo.AreaResult> result = dataStatisticsService.queryData(params.getParam(),params.getUserId()); |
|||
log.info("市或地区静脉溶率统计结束:{}",result); |
|||
return JsonResponse.newInstance().ok(result); |
|||
} |
|||
} |
@ -0,0 +1,107 @@ |
|||
package com.ccsens.carbasics.bean.po; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
public class QuestionnaireDataDatumLine implements Serializable { |
|||
private Long id; |
|||
|
|||
private String name; |
|||
|
|||
private BigDecimal datumLine; |
|||
|
|||
private Byte type; |
|||
|
|||
private String remark; |
|||
|
|||
private Date createdAt; |
|||
|
|||
private Date updatedAt; |
|||
|
|||
private Byte recStatus; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name == null ? null : name.trim(); |
|||
} |
|||
|
|||
public BigDecimal getDatumLine() { |
|||
return datumLine; |
|||
} |
|||
|
|||
public void setDatumLine(BigDecimal datumLine) { |
|||
this.datumLine = datumLine; |
|||
} |
|||
|
|||
public Byte getType() { |
|||
return type; |
|||
} |
|||
|
|||
public void setType(Byte type) { |
|||
this.type = type; |
|||
} |
|||
|
|||
public String getRemark() { |
|||
return remark; |
|||
} |
|||
|
|||
public void setRemark(String remark) { |
|||
this.remark = remark == null ? null : remark.trim(); |
|||
} |
|||
|
|||
public Date getCreatedAt() { |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) { |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() { |
|||
return updatedAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) { |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
public Byte getRecStatus() { |
|||
return recStatus; |
|||
} |
|||
|
|||
public void setRecStatus(Byte recStatus) { |
|||
this.recStatus = recStatus; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
StringBuilder sb = new StringBuilder(); |
|||
sb.append(getClass().getSimpleName()); |
|||
sb.append(" ["); |
|||
sb.append("Hash = ").append(hashCode()); |
|||
sb.append(", id=").append(id); |
|||
sb.append(", name=").append(name); |
|||
sb.append(", datumLine=").append(datumLine); |
|||
sb.append(", type=").append(type); |
|||
sb.append(", remark=").append(remark); |
|||
sb.append(", createdAt=").append(createdAt); |
|||
sb.append(", updatedAt=").append(updatedAt); |
|||
sb.append(", recStatus=").append(recStatus); |
|||
sb.append("]"); |
|||
return sb.toString(); |
|||
} |
|||
} |
@ -0,0 +1,702 @@ |
|||
package com.ccsens.carbasics.bean.po; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
public class QuestionnaireDataDatumLineExample { |
|||
protected String orderByClause; |
|||
|
|||
protected boolean distinct; |
|||
|
|||
protected List<Criteria> oredCriteria; |
|||
|
|||
public QuestionnaireDataDatumLineExample() { |
|||
oredCriteria = new ArrayList<Criteria>(); |
|||
} |
|||
|
|||
public void setOrderByClause(String orderByClause) { |
|||
this.orderByClause = orderByClause; |
|||
} |
|||
|
|||
public String getOrderByClause() { |
|||
return orderByClause; |
|||
} |
|||
|
|||
public void setDistinct(boolean distinct) { |
|||
this.distinct = distinct; |
|||
} |
|||
|
|||
public boolean isDistinct() { |
|||
return distinct; |
|||
} |
|||
|
|||
public List<Criteria> getOredCriteria() { |
|||
return oredCriteria; |
|||
} |
|||
|
|||
public void or(Criteria criteria) { |
|||
oredCriteria.add(criteria); |
|||
} |
|||
|
|||
public Criteria or() { |
|||
Criteria criteria = createCriteriaInternal(); |
|||
oredCriteria.add(criteria); |
|||
return criteria; |
|||
} |
|||
|
|||
public Criteria createCriteria() { |
|||
Criteria criteria = createCriteriaInternal(); |
|||
if (oredCriteria.size() == 0) { |
|||
oredCriteria.add(criteria); |
|||
} |
|||
return criteria; |
|||
} |
|||
|
|||
protected Criteria createCriteriaInternal() { |
|||
Criteria criteria = new Criteria(); |
|||
return criteria; |
|||
} |
|||
|
|||
public void clear() { |
|||
oredCriteria.clear(); |
|||
orderByClause = null; |
|||
distinct = false; |
|||
} |
|||
|
|||
protected abstract static class GeneratedCriteria { |
|||
protected List<Criterion> criteria; |
|||
|
|||
protected GeneratedCriteria() { |
|||
super(); |
|||
criteria = new ArrayList<Criterion>(); |
|||
} |
|||
|
|||
public boolean isValid() { |
|||
return criteria.size() > 0; |
|||
} |
|||
|
|||
public List<Criterion> getAllCriteria() { |
|||
return criteria; |
|||
} |
|||
|
|||
public List<Criterion> getCriteria() { |
|||
return criteria; |
|||
} |
|||
|
|||
protected void addCriterion(String condition) { |
|||
if (condition == null) { |
|||
throw new RuntimeException("Value for condition cannot be null"); |
|||
} |
|||
criteria.add(new Criterion(condition)); |
|||
} |
|||
|
|||
protected void addCriterion(String condition, Object value, String property) { |
|||
if (value == null) { |
|||
throw new RuntimeException("Value for " + property + " cannot be null"); |
|||
} |
|||
criteria.add(new Criterion(condition, value)); |
|||
} |
|||
|
|||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
|||
if (value1 == null || value2 == null) { |
|||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
|||
} |
|||
criteria.add(new Criterion(condition, value1, value2)); |
|||
} |
|||
|
|||
public Criteria andIdIsNull() { |
|||
addCriterion("id is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdIsNotNull() { |
|||
addCriterion("id is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdEqualTo(Long value) { |
|||
addCriterion("id =", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdNotEqualTo(Long value) { |
|||
addCriterion("id <>", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdGreaterThan(Long value) { |
|||
addCriterion("id >", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
|||
addCriterion("id >=", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdLessThan(Long value) { |
|||
addCriterion("id <", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdLessThanOrEqualTo(Long value) { |
|||
addCriterion("id <=", value, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdIn(List<Long> values) { |
|||
addCriterion("id in", values, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdNotIn(List<Long> values) { |
|||
addCriterion("id not in", values, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdBetween(Long value1, Long value2) { |
|||
addCriterion("id between", value1, value2, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andIdNotBetween(Long value1, Long value2) { |
|||
addCriterion("id not between", value1, value2, "id"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameIsNull() { |
|||
addCriterion("name is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameIsNotNull() { |
|||
addCriterion("name is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameEqualTo(String value) { |
|||
addCriterion("name =", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameNotEqualTo(String value) { |
|||
addCriterion("name <>", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameGreaterThan(String value) { |
|||
addCriterion("name >", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameGreaterThanOrEqualTo(String value) { |
|||
addCriterion("name >=", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameLessThan(String value) { |
|||
addCriterion("name <", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameLessThanOrEqualTo(String value) { |
|||
addCriterion("name <=", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameLike(String value) { |
|||
addCriterion("name like", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameNotLike(String value) { |
|||
addCriterion("name not like", value, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameIn(List<String> values) { |
|||
addCriterion("name in", values, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameNotIn(List<String> values) { |
|||
addCriterion("name not in", values, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameBetween(String value1, String value2) { |
|||
addCriterion("name between", value1, value2, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andNameNotBetween(String value1, String value2) { |
|||
addCriterion("name not between", value1, value2, "name"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineIsNull() { |
|||
addCriterion("datum_line is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineIsNotNull() { |
|||
addCriterion("datum_line is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineEqualTo(BigDecimal value) { |
|||
addCriterion("datum_line =", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineNotEqualTo(BigDecimal value) { |
|||
addCriterion("datum_line <>", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineGreaterThan(BigDecimal value) { |
|||
addCriterion("datum_line >", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineGreaterThanOrEqualTo(BigDecimal value) { |
|||
addCriterion("datum_line >=", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineLessThan(BigDecimal value) { |
|||
addCriterion("datum_line <", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineLessThanOrEqualTo(BigDecimal value) { |
|||
addCriterion("datum_line <=", value, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineIn(List<BigDecimal> values) { |
|||
addCriterion("datum_line in", values, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineNotIn(List<BigDecimal> values) { |
|||
addCriterion("datum_line not in", values, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineBetween(BigDecimal value1, BigDecimal value2) { |
|||
addCriterion("datum_line between", value1, value2, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andDatumLineNotBetween(BigDecimal value1, BigDecimal value2) { |
|||
addCriterion("datum_line not between", value1, value2, "datumLine"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeIsNull() { |
|||
addCriterion("type is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeIsNotNull() { |
|||
addCriterion("type is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeEqualTo(Byte value) { |
|||
addCriterion("type =", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeNotEqualTo(Byte value) { |
|||
addCriterion("type <>", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeGreaterThan(Byte value) { |
|||
addCriterion("type >", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeGreaterThanOrEqualTo(Byte value) { |
|||
addCriterion("type >=", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeLessThan(Byte value) { |
|||
addCriterion("type <", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeLessThanOrEqualTo(Byte value) { |
|||
addCriterion("type <=", value, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeIn(List<Byte> values) { |
|||
addCriterion("type in", values, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeNotIn(List<Byte> values) { |
|||
addCriterion("type not in", values, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeBetween(Byte value1, Byte value2) { |
|||
addCriterion("type between", value1, value2, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andTypeNotBetween(Byte value1, Byte value2) { |
|||
addCriterion("type not between", value1, value2, "type"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkIsNull() { |
|||
addCriterion("remark is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkIsNotNull() { |
|||
addCriterion("remark is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkEqualTo(String value) { |
|||
addCriterion("remark =", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkNotEqualTo(String value) { |
|||
addCriterion("remark <>", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkGreaterThan(String value) { |
|||
addCriterion("remark >", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkGreaterThanOrEqualTo(String value) { |
|||
addCriterion("remark >=", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkLessThan(String value) { |
|||
addCriterion("remark <", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkLessThanOrEqualTo(String value) { |
|||
addCriterion("remark <=", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkLike(String value) { |
|||
addCriterion("remark like", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkNotLike(String value) { |
|||
addCriterion("remark not like", value, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkIn(List<String> values) { |
|||
addCriterion("remark in", values, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkNotIn(List<String> values) { |
|||
addCriterion("remark not in", values, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkBetween(String value1, String value2) { |
|||
addCriterion("remark between", value1, value2, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRemarkNotBetween(String value1, String value2) { |
|||
addCriterion("remark not between", value1, value2, "remark"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtIsNull() { |
|||
addCriterion("created_at is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtIsNotNull() { |
|||
addCriterion("created_at is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtEqualTo(Date value) { |
|||
addCriterion("created_at =", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotEqualTo(Date value) { |
|||
addCriterion("created_at <>", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtGreaterThan(Date value) { |
|||
addCriterion("created_at >", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
|||
addCriterion("created_at >=", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtLessThan(Date value) { |
|||
addCriterion("created_at <", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
|||
addCriterion("created_at <=", value, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtIn(List<Date> values) { |
|||
addCriterion("created_at in", values, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotIn(List<Date> values) { |
|||
addCriterion("created_at not in", values, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
|||
addCriterion("created_at between", value1, value2, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
|||
addCriterion("created_at not between", value1, value2, "createdAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtIsNull() { |
|||
addCriterion("updated_at is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtIsNotNull() { |
|||
addCriterion("updated_at is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtEqualTo(Date value) { |
|||
addCriterion("updated_at =", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotEqualTo(Date value) { |
|||
addCriterion("updated_at <>", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtGreaterThan(Date value) { |
|||
addCriterion("updated_at >", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
|||
addCriterion("updated_at >=", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtLessThan(Date value) { |
|||
addCriterion("updated_at <", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
|||
addCriterion("updated_at <=", value, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtIn(List<Date> values) { |
|||
addCriterion("updated_at in", values, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotIn(List<Date> values) { |
|||
addCriterion("updated_at not in", values, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
|||
addCriterion("updated_at between", value1, value2, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
|||
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusIsNull() { |
|||
addCriterion("rec_status is null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusIsNotNull() { |
|||
addCriterion("rec_status is not null"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusEqualTo(Byte value) { |
|||
addCriterion("rec_status =", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusNotEqualTo(Byte value) { |
|||
addCriterion("rec_status <>", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusGreaterThan(Byte value) { |
|||
addCriterion("rec_status >", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
|||
addCriterion("rec_status >=", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusLessThan(Byte value) { |
|||
addCriterion("rec_status <", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
|||
addCriterion("rec_status <=", value, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusIn(List<Byte> values) { |
|||
addCriterion("rec_status in", values, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusNotIn(List<Byte> values) { |
|||
addCriterion("rec_status not in", values, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
|||
addCriterion("rec_status between", value1, value2, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
|
|||
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
|||
addCriterion("rec_status not between", value1, value2, "recStatus"); |
|||
return (Criteria) this; |
|||
} |
|||
} |
|||
|
|||
public static class Criteria extends GeneratedCriteria { |
|||
|
|||
protected Criteria() { |
|||
super(); |
|||
} |
|||
} |
|||
|
|||
public static class Criterion { |
|||
private String condition; |
|||
|
|||
private Object value; |
|||
|
|||
private Object secondValue; |
|||
|
|||
private boolean noValue; |
|||
|
|||
private boolean singleValue; |
|||
|
|||
private boolean betweenValue; |
|||
|
|||
private boolean listValue; |
|||
|
|||
private String typeHandler; |
|||
|
|||
public String getCondition() { |
|||
return condition; |
|||
} |
|||
|
|||
public Object getValue() { |
|||
return value; |
|||
} |
|||
|
|||
public Object getSecondValue() { |
|||
return secondValue; |
|||
} |
|||
|
|||
public boolean isNoValue() { |
|||
return noValue; |
|||
} |
|||
|
|||
public boolean isSingleValue() { |
|||
return singleValue; |
|||
} |
|||
|
|||
public boolean isBetweenValue() { |
|||
return betweenValue; |
|||
} |
|||
|
|||
public boolean isListValue() { |
|||
return listValue; |
|||
} |
|||
|
|||
public String getTypeHandler() { |
|||
return typeHandler; |
|||
} |
|||
|
|||
protected Criterion(String condition) { |
|||
super(); |
|||
this.condition = condition; |
|||
this.typeHandler = null; |
|||
this.noValue = true; |
|||
} |
|||
|
|||
protected Criterion(String condition, Object value, String typeHandler) { |
|||
super(); |
|||
this.condition = condition; |
|||
this.value = value; |
|||
this.typeHandler = typeHandler; |
|||
if (value instanceof List<?>) { |
|||
this.listValue = true; |
|||
} else { |
|||
this.singleValue = true; |
|||
} |
|||
} |
|||
|
|||
protected Criterion(String condition, Object value) { |
|||
this(condition, value, null); |
|||
} |
|||
|
|||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
|||
super(); |
|||
this.condition = condition; |
|||
this.value = value; |
|||
this.secondValue = secondValue; |
|||
this.typeHandler = typeHandler; |
|||
this.betweenValue = true; |
|||
} |
|||
|
|||
protected Criterion(String condition, Object value, Object secondValue) { |
|||
this(condition, value, secondValue, null); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.ccsens.carbasics.persist.dao; |
|||
|
|||
import com.ccsens.carbasics.bean.vo.StatisticsVo; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface DataStatisticsDao { |
|||
|
|||
/** |
|||
* 静脉溶栓统计(全部/二级/三级) |
|||
* @return 静脉溶栓统计 |
|||
*/ |
|||
StatisticsVo.JmrsUpResult statisticsJmrs(); |
|||
|
|||
/** |
|||
* 查询各医院溶栓率 |
|||
* @param type 查询类型(0-三级,1-二级) |
|||
* @param areaId 市id |
|||
* @return 二级医院溶栓率 |
|||
*/ |
|||
List<StatisticsVo.AreaResult> queryJmrsForHospital(@Param("type")Byte type,@Param("areaId") Long areaId); |
|||
|
|||
/** |
|||
* 查询各市溶栓率 |
|||
* @param type 查询类型(0-三级,1-二级) |
|||
* @return 三级医院溶栓率 |
|||
*/ |
|||
List<StatisticsVo.AreaResult> queryJmrslForCity(@Param("type") Byte type); |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.ccsens.carbasics.persist.dao; |
|||
|
|||
import com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine; |
|||
import com.ccsens.carbasics.bean.vo.StatisticsVo; |
|||
import com.ccsens.carbasics.persist.mapper.QuestionnaireDataDatumLineMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface QuestionnaireDataDatumLineDao extends QuestionnaireDataDatumLineMapper { |
|||
|
|||
/** |
|||
* 查询全部基准线 |
|||
* @param type 基准线类型 |
|||
* @return 基准线列表 |
|||
*/ |
|||
List<QuestionnaireDataDatumLine> queryAll(@Param("type")Byte type); |
|||
|
|||
/** |
|||
* 查询基准线 |
|||
* @param type 基准线类型 |
|||
* @return 基准线列表 |
|||
*/ |
|||
List<StatisticsVo.AreaResult> queryAllForJmrsl(@Param("type")Byte type); |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.ccsens.carbasics.persist.mapper; |
|||
|
|||
import com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine; |
|||
import com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLineExample; |
|||
import java.util.List; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface QuestionnaireDataDatumLineMapper { |
|||
long countByExample(QuestionnaireDataDatumLineExample example); |
|||
|
|||
int deleteByExample(QuestionnaireDataDatumLineExample example); |
|||
|
|||
int deleteByPrimaryKey(Long id); |
|||
|
|||
int insert(QuestionnaireDataDatumLine record); |
|||
|
|||
int insertSelective(QuestionnaireDataDatumLine record); |
|||
|
|||
List<QuestionnaireDataDatumLine> selectByExample(QuestionnaireDataDatumLineExample example); |
|||
|
|||
QuestionnaireDataDatumLine selectByPrimaryKey(Long id); |
|||
|
|||
int updateByExampleSelective(@Param("record") QuestionnaireDataDatumLine record, @Param("example") QuestionnaireDataDatumLineExample example); |
|||
|
|||
int updateByExample(@Param("record") QuestionnaireDataDatumLine record, @Param("example") QuestionnaireDataDatumLineExample example); |
|||
|
|||
int updateByPrimaryKeySelective(QuestionnaireDataDatumLine record); |
|||
|
|||
int updateByPrimaryKey(QuestionnaireDataDatumLine record); |
|||
} |
@ -0,0 +1,104 @@ |
|||
package com.ccsens.carbasics.service; |
|||
|
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.ccsens.carbasics.bean.dto.StatisticsDto; |
|||
import com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine; |
|||
import com.ccsens.carbasics.bean.vo.StatisticsVo; |
|||
import com.ccsens.carbasics.persist.dao.DataStatisticsDao; |
|||
import com.ccsens.carbasics.persist.dao.QuestionnaireDataDatumLineDao; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.Comparator; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|||
public class DataStatisticsService implements IDataStatisticsService { |
|||
|
|||
@Resource |
|||
private DataStatisticsDao dataStatisticsDao; |
|||
@Resource |
|||
private QuestionnaireDataDatumLineDao dataDatumLineDao; |
|||
|
|||
|
|||
@Override |
|||
public StatisticsVo.JmrsUpResult statisticsJmrs(Long userId) { |
|||
return dataStatisticsDao.statisticsJmrs(); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public StatisticsVo.StandardsResult queryStandards(StatisticsDto.QueryStandards param, Long userId) { |
|||
StatisticsVo.StandardsResult result = new StatisticsVo.StandardsResult(); |
|||
//查询基准线
|
|||
QuestionnaireDataDatumLine basics = new QuestionnaireDataDatumLine(); |
|||
QuestionnaireDataDatumLine advance = new QuestionnaireDataDatumLine(); |
|||
List<QuestionnaireDataDatumLine> dataDatumLineList = dataDatumLineDao.queryAll((byte) 0); |
|||
if (CollectionUtil.isNotEmpty(dataDatumLineList)) { |
|||
for (QuestionnaireDataDatumLine dataDatumLine : dataDatumLineList) { |
|||
if ("基础目标".equals(dataDatumLine.getName())) { |
|||
BeanUtil.copyProperties(dataDatumLine,basics); |
|||
} |
|||
if ("进阶目标".equals(dataDatumLine.getName())) { |
|||
BeanUtil.copyProperties(dataDatumLine,advance); |
|||
} |
|||
} |
|||
} |
|||
List<StatisticsVo.AreaResult> areaResults = new ArrayList<>(); |
|||
if (0 == param.getQueryType()) { |
|||
areaResults = dataStatisticsDao.queryJmrslForCity(param.getQueryLevel()); |
|||
} |
|||
if (1 == param.getQueryType()) { |
|||
areaResults = dataStatisticsDao.queryJmrsForHospital(param.getQueryLevel(),param.getAreaId()); |
|||
} |
|||
int arrive = 0; |
|||
int unArrive = 0; |
|||
if (CollectionUtil.isNotEmpty(areaResults)) { |
|||
for (StatisticsVo.AreaResult areaResult : areaResults) { |
|||
if (areaResult.getValue().compareTo(advance.getDatumLine()) > -1) { |
|||
arrive++; |
|||
} |
|||
if (areaResult.getValue().compareTo(basics.getDatumLine()) < 1) { |
|||
unArrive++; |
|||
} |
|||
} |
|||
result.setGreaterThan70(arrive); |
|||
result.setLessThan50(unArrive); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public List<StatisticsVo.AreaResult> queryData(StatisticsDto.QueryStandards param, Long userId) { |
|||
//查询基准线
|
|||
List<StatisticsVo.AreaResult> dataDatumLineList = dataDatumLineDao.queryAllForJmrsl((byte) 0); |
|||
|
|||
List<StatisticsVo.AreaResult> areaResults = new ArrayList<>(); |
|||
if (0 == param.getQueryType()) { |
|||
areaResults = dataStatisticsDao.queryJmrslForCity(param.getQueryLevel()); |
|||
List<StatisticsVo.AreaResult> cityJmsrl = dataStatisticsDao.queryJmrslForCity(null); |
|||
for (StatisticsVo.AreaResult areaResult : areaResults) { |
|||
for (StatisticsVo.AreaResult result : cityJmsrl) { |
|||
if (areaResult.getName().equals(result.getName())) { |
|||
areaResult.setCityAllJmrsl(result.getValue()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
if (1 == param.getQueryType()) { |
|||
areaResults = dataStatisticsDao.queryJmrsForHospital(param.getQueryLevel(),param.getAreaId()); |
|||
} |
|||
areaResults.addAll(dataDatumLineList); |
|||
List<StatisticsVo.AreaResult> results = areaResults.stream().sorted(Comparator.comparing(StatisticsVo.AreaResult::getValue).reversed()).collect(Collectors.toList()); |
|||
return results; |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.ccsens.carbasics.service; |
|||
|
|||
import com.ccsens.carbasics.bean.dto.StatisticsDto; |
|||
import com.ccsens.carbasics.bean.vo.StatisticsVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author AUSU |
|||
*/ |
|||
public interface IDataStatisticsService { |
|||
|
|||
/** |
|||
* 统计静脉溶栓率(上部分) |
|||
* @param userId 用户id |
|||
* @return 静脉溶栓率,二/三级医院静脉溶栓率 |
|||
*/ |
|||
StatisticsVo.JmrsUpResult statisticsJmrs(Long userId); |
|||
|
|||
/** |
|||
* 查询静脉溶栓达标率 |
|||
* @param param 查询类型(0-三级,1-二级) |
|||
* @param userId 用户id |
|||
* @return 达标情况 |
|||
*/ |
|||
StatisticsVo.StandardsResult queryStandards(StatisticsDto.QueryStandards param, Long userId); |
|||
|
|||
/** |
|||
* 查询市或地区的溶栓率 |
|||
* @param param 查询类型/查询医院类型/市id |
|||
* @param userId 用户id |
|||
* @return 各市/医院的溶栓率 |
|||
*/ |
|||
List<StatisticsVo.AreaResult> queryData(StatisticsDto.QueryStandards param, Long userId); |
|||
} |
@ -0,0 +1,224 @@ |
|||
<?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.ccsens.carbasics.persist.dao.DataStatisticsDao"> |
|||
|
|||
<select id="statisticsJmrs" resultType="com.ccsens.carbasics.bean.vo.StatisticsVo$JmrsUpResult"> |
|||
SELECT |
|||
round(allActual.`value` * 100 / allAis.`value`,2) AS jmrsl, |
|||
round(allTwoActual.`value` * 100 / allTwoAis.`value`,2) AS twoJmrsl, |
|||
round(allThreeActual.`value` * 100 / allThreeAis.`value`,2) AS threeJmrsl |
|||
FROM |
|||
(SELECT |
|||
SUM( actual.answer ) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS actual |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON actual.questionnaire_detail_id = qd.id |
|||
WHERE |
|||
actual.rec_status = 0 |
|||
AND qd.rec_status = 0 |
|||
AND qd.submit_status = 1 |
|||
AND actual.question_code = 'actual-Nnt') AS allActual, |
|||
(SELECT |
|||
SUM( ais.answer ) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS ais |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON ais.questionnaire_detail_id = qd.id |
|||
WHERE |
|||
ais.rec_status = 0 |
|||
AND qd.rec_status =0 |
|||
AND qd.submit_status = 1 |
|||
AND ais.question_code = 'AIS-Nnt') AS allAis, |
|||
(SELECT |
|||
SUM(twoActual.answer) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS twoActual |
|||
LEFT JOIN t_qcp_questionnaire_record AS twoActual2 ON twoActual.questionnaire_detail_id = twoActual2.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qd.id = twoActual.questionnaire_detail_id AND qd.id = twoActual2.questionnaire_detail_id |
|||
WHERE |
|||
twoActual.rec_status = 0 |
|||
AND twoActual2.rec_status = 0 |
|||
AND twoActual2.answer = '二级' |
|||
AND twoActual.question_code = 'actual-Nnt' |
|||
AND qd.rec_status = 0 AND qd.submit_status = 1) AS allTwoActual, |
|||
(SELECT |
|||
SUM(twoAis.answer) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS twoAis |
|||
LEFT JOIN t_qcp_questionnaire_record AS twoAis2 ON twoAis.questionnaire_detail_id = twoAis2.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qd.id = twoAis2.questionnaire_detail_id AND qd.id = twoAis.questionnaire_detail_id |
|||
WHERE |
|||
twoAis.rec_status = 0 |
|||
AND twoAis2.rec_status = 0 |
|||
AND twoAis2.answer = '二级' |
|||
AND twoAis.question_code = 'AIS-Nnt' |
|||
AND qd.rec_status = 0 AND qd.submit_status = 1) AS allTwoAis, |
|||
(SELECT |
|||
SUM(threeActual.answer) AS value |
|||
FROM |
|||
t_qcp_questionnaire_record AS threeActual |
|||
LEFT JOIN t_qcp_questionnaire_record AS threeActual2 ON threeActual.questionnaire_detail_id = threeActual2.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qd.id = threeActual.questionnaire_detail_id AND qd.id = threeActual2.questionnaire_detail_id |
|||
WHERE |
|||
threeActual.rec_status = 0 |
|||
AND threeActual2.rec_status = 0 |
|||
AND threeActual2.answer = '三级' |
|||
AND threeActual.question_code = 'actual-Nnt' |
|||
AND qd.rec_status = 0 AND qd.submit_status = 1) AS allThreeActual, |
|||
(SELECT |
|||
SUM(threeAis.answer) AS value |
|||
FROM |
|||
t_qcp_questionnaire_record AS threeAis |
|||
LEFT JOIN t_qcp_questionnaire_record AS threeAis2 ON threeAis.questionnaire_detail_id = threeAis2.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qd.id = threeAis.questionnaire_detail_id AND qd.id = threeAis2.questionnaire_detail_id |
|||
WHERE |
|||
threeAis.rec_status = 0 |
|||
AND threeAis2.rec_status = 0 |
|||
AND threeAis2.answer = '三级' |
|||
AND threeAis.question_code = 'AIS-Nnt' |
|||
AND qd.rec_status = 0 AND qd.submit_status = 1) AS allThreeAis |
|||
</select> |
|||
|
|||
<select id="queryJmrsForHospital" resultType="com.ccsens.carbasics.bean.vo.StatisticsVo$AreaResult"> |
|||
SELECT |
|||
gediAis.hname AS `name`, |
|||
IFNULL(round(gediRszs.`value` * 100 / gediAis.`value`,1),0) AS `value`, |
|||
gediRszs.`value` AS rsTotal |
|||
FROM |
|||
(SELECT |
|||
qr.answer AS area, |
|||
qr2.answer AS `value`, |
|||
qr3.answer As hname |
|||
FROM |
|||
t_qcp_questionnaire_record AS qr |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qr.questionnaire_detail_id = qd.id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr2 ON qr2.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr3 ON qr3.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
<if test="type == 0 or type == 1"> |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr4 ON qr4.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
</if> |
|||
WHERE |
|||
qr.rec_status = 0 |
|||
AND qr.question_code = 'CITY-COUNTY' |
|||
AND qd.rec_status = 0 |
|||
AND qd.submit_status = 1 |
|||
AND qr2.rec_status = 0 |
|||
AND qr2.question_code = 'actual-Nnt' |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-NAME' |
|||
AND SUBSTRING_INDEX(qr.answer,',',1) = #{areaId} |
|||
<if test="type == 0"> |
|||
AND qr4.rec_status = 0 |
|||
AND qr4.question_code = 'HOS-LEVEL' |
|||
AND qr4.answer = '三级' |
|||
</if> |
|||
<if test="type == 1"> |
|||
AND qr4.rec_status = 0 |
|||
AND qr4.question_code = 'HOS-LEVEL' |
|||
AND qr4.answer = '二级' |
|||
</if> |
|||
) AS gediRszs, |
|||
(SELECT |
|||
qr.answer AS area, |
|||
qr2.answer AS `value`, |
|||
qr3.answer As hname |
|||
FROM |
|||
t_qcp_questionnaire_record AS qr |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qr.questionnaire_detail_id = qd.id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr2 ON qr2.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr3 ON qr3.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr4 ON qr4.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
WHERE |
|||
qr.rec_status = 0 |
|||
AND qr.question_code = 'CITY-COUNTY' |
|||
AND qd.rec_status = 0 |
|||
AND qd.submit_status = 1 |
|||
AND qr2.rec_status = 0 |
|||
AND qr2.question_code = 'AIS-Nnt' |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-NAME' |
|||
AND SUBSTRING_INDEX(qr.answer,',',1) = #{areaId} |
|||
<if test="type == 0"> |
|||
AND qr4.rec_status = 0 |
|||
AND qr4.question_code = 'HOS-LEVEL' |
|||
AND qr4.answer = '三级' |
|||
</if> |
|||
<if test="type == 1"> |
|||
AND qr4.rec_status = 0 |
|||
AND qr4.question_code = 'HOS-LEVEL' |
|||
AND qr4.answer = '二级' |
|||
</if> |
|||
) AS gediAis |
|||
WHERE gediRszs.hname = gediAis.hname |
|||
</select> |
|||
|
|||
<select id="queryJmrslForCity" resultType="com.ccsens.carbasics.bean.vo.StatisticsVo$AreaResult"> |
|||
SELECT |
|||
a.id AS areaId, |
|||
a.area_name AS `name`, |
|||
IFNULL(round(gediRszs.`value` * 100 / gediAis.`value`,1),0) AS `value` |
|||
FROM |
|||
(SELECT |
|||
qr.answer AS area, |
|||
SUM(qr2.answer) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS qr |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qr.questionnaire_detail_id = qd.id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr2 ON qr2.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
<if test="type == 0 or type == 1"> |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr3 ON qr3.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
</if> |
|||
WHERE |
|||
qr.rec_status = 0 |
|||
AND qr.question_code = 'CITY-COUNTY' |
|||
AND qd.rec_status = 0 |
|||
AND qd.submit_status = 1 |
|||
AND qr2.rec_status = 0 |
|||
AND qr2.question_code = 'actual-Nnt' |
|||
<if test="type == 0"> |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-LEVEL' |
|||
AND qr3.answer = '三级' |
|||
</if> |
|||
<if test="type == 1"> |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-LEVEL' |
|||
AND qr3.answer = '二级' |
|||
</if> |
|||
GROUP BY SUBSTRING_INDEX(qr.answer,',',1) |
|||
) AS gediRszs, |
|||
(SELECT |
|||
qr.answer AS area, |
|||
SUM(qr2.answer) AS `value` |
|||
FROM |
|||
t_qcp_questionnaire_record AS qr |
|||
LEFT JOIN t_qcp_questionnaire_detail AS qd ON qr.questionnaire_detail_id = qd.id |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr2 ON qr2.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
<if test="type == 0 or type == 1"> |
|||
LEFT JOIN t_qcp_questionnaire_record AS qr3 ON qr3.questionnaire_detail_id = qr.questionnaire_detail_id |
|||
</if> |
|||
WHERE |
|||
qr.rec_status = 0 |
|||
AND qr.question_code = 'CITY-COUNTY' |
|||
AND qd.rec_status = 0 |
|||
AND qd.submit_status = 1 |
|||
AND qr2.rec_status = 0 |
|||
AND qr2.question_code = 'AIS-Nnt' |
|||
<if test="type == 0"> |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-LEVEL' |
|||
AND qr3.answer = '三级' |
|||
</if> |
|||
<if test="type == 1"> |
|||
AND qr3.rec_status = 0 |
|||
AND qr3.question_code = 'HOS-LEVEL' |
|||
AND qr3.answer = '二级' |
|||
</if> |
|||
GROUP BY SUBSTRING_INDEX(qr.answer,',',1) |
|||
) AS gediAis |
|||
,t_area AS a |
|||
WHERE gediRszs.area = gediAis.area |
|||
AND a.rec_status = 0 |
|||
AND SUBSTRING_INDEX(gediRszs.area,',',1) = a.id |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,31 @@ |
|||
<?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.ccsens.carbasics.persist.dao.QuestionnaireDataDatumLineDao"> |
|||
|
|||
<select id="queryAll" resultType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
SELECT |
|||
id, |
|||
`name`, |
|||
datum_line, |
|||
type, |
|||
remark |
|||
FROM |
|||
t_qcp_questionnaire_data_datum_line |
|||
WHERE |
|||
rec_status = 0 |
|||
AND type = #{type} |
|||
</select> |
|||
|
|||
<select id="queryAllForJmrsl" resultType="com.ccsens.carbasics.bean.vo.StatisticsVo$AreaResult"> |
|||
SELECT |
|||
`name`, |
|||
datum_line AS `value`, |
|||
datum_line AS cityAllJmrsl |
|||
FROM |
|||
t_qcp_questionnaire_data_datum_line |
|||
WHERE |
|||
rec_status = 0 |
|||
AND type = 0 |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,258 @@ |
|||
<?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.ccsens.carbasics.persist.mapper.QuestionnaireDataDatumLineMapper"> |
|||
<resultMap id="BaseResultMap" type="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="name" jdbcType="VARCHAR" property="name" /> |
|||
<result column="datum_line" jdbcType="DECIMAL" property="datumLine" /> |
|||
<result column="type" jdbcType="TINYINT" property="type" /> |
|||
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
|||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
|||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
|||
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
|||
</resultMap> |
|||
<sql id="Example_Where_Clause"> |
|||
<where> |
|||
<foreach collection="oredCriteria" item="criteria" separator="or"> |
|||
<if test="criteria.valid"> |
|||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|||
<foreach collection="criteria.criteria" item="criterion"> |
|||
<choose> |
|||
<when test="criterion.noValue"> |
|||
and ${criterion.condition} |
|||
</when> |
|||
<when test="criterion.singleValue"> |
|||
and ${criterion.condition} #{criterion.value} |
|||
</when> |
|||
<when test="criterion.betweenValue"> |
|||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|||
</when> |
|||
<when test="criterion.listValue"> |
|||
and ${criterion.condition} |
|||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|||
#{listItem} |
|||
</foreach> |
|||
</when> |
|||
</choose> |
|||
</foreach> |
|||
</trim> |
|||
</if> |
|||
</foreach> |
|||
</where> |
|||
</sql> |
|||
<sql id="Update_By_Example_Where_Clause"> |
|||
<where> |
|||
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
|||
<if test="criteria.valid"> |
|||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|||
<foreach collection="criteria.criteria" item="criterion"> |
|||
<choose> |
|||
<when test="criterion.noValue"> |
|||
and ${criterion.condition} |
|||
</when> |
|||
<when test="criterion.singleValue"> |
|||
and ${criterion.condition} #{criterion.value} |
|||
</when> |
|||
<when test="criterion.betweenValue"> |
|||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|||
</when> |
|||
<when test="criterion.listValue"> |
|||
and ${criterion.condition} |
|||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|||
#{listItem} |
|||
</foreach> |
|||
</when> |
|||
</choose> |
|||
</foreach> |
|||
</trim> |
|||
</if> |
|||
</foreach> |
|||
</where> |
|||
</sql> |
|||
<sql id="Base_Column_List"> |
|||
id, name, datum_line, type, remark, created_at, updated_at, rec_status |
|||
</sql> |
|||
<select id="selectByExample" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLineExample" resultMap="BaseResultMap"> |
|||
select |
|||
<if test="distinct"> |
|||
distinct |
|||
</if> |
|||
<include refid="Base_Column_List" /> |
|||
from t_qcp_questionnaire_data_datum_line |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
<if test="orderByClause != null"> |
|||
order by ${orderByClause} |
|||
</if> |
|||
</select> |
|||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_qcp_questionnaire_data_datum_line |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</select> |
|||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
|||
delete from t_qcp_questionnaire_data_datum_line |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</delete> |
|||
<delete id="deleteByExample" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLineExample"> |
|||
delete from t_qcp_questionnaire_data_datum_line |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</delete> |
|||
<insert id="insert" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
insert into t_qcp_questionnaire_data_datum_line (id, name, datum_line, |
|||
type, remark, created_at, |
|||
updated_at, rec_status) |
|||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{datumLine,jdbcType=DECIMAL}, |
|||
#{type,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, |
|||
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) |
|||
</insert> |
|||
<insert id="insertSelective" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
insert into t_qcp_questionnaire_data_datum_line |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="id != null"> |
|||
id, |
|||
</if> |
|||
<if test="name != null"> |
|||
name, |
|||
</if> |
|||
<if test="datumLine != null"> |
|||
datum_line, |
|||
</if> |
|||
<if test="type != null"> |
|||
type, |
|||
</if> |
|||
<if test="remark != null"> |
|||
remark, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
created_at, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
updated_at, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
rec_status, |
|||
</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="id != null"> |
|||
#{id,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="name != null"> |
|||
#{name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="datumLine != null"> |
|||
#{datumLine,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="type != null"> |
|||
#{type,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="remark != null"> |
|||
#{remark,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
#{createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
#{updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
#{recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</trim> |
|||
</insert> |
|||
<select id="countByExample" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLineExample" resultType="java.lang.Long"> |
|||
select count(*) from t_qcp_questionnaire_data_datum_line |
|||
<if test="_parameter != null"> |
|||
<include refid="Example_Where_Clause" /> |
|||
</if> |
|||
</select> |
|||
<update id="updateByExampleSelective" parameterType="map"> |
|||
update t_qcp_questionnaire_data_datum_line |
|||
<set> |
|||
<if test="record.id != null"> |
|||
id = #{record.id,jdbcType=BIGINT}, |
|||
</if> |
|||
<if test="record.name != null"> |
|||
name = #{record.name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.datumLine != null"> |
|||
datum_line = #{record.datumLine,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="record.type != null"> |
|||
type = #{record.type,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="record.remark != null"> |
|||
remark = #{record.remark,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.createdAt != null"> |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.updatedAt != null"> |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.recStatus != null"> |
|||
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</set> |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByExample" parameterType="map"> |
|||
update t_qcp_questionnaire_data_datum_line |
|||
set id = #{record.id,jdbcType=BIGINT}, |
|||
name = #{record.name,jdbcType=VARCHAR}, |
|||
datum_line = #{record.datumLine,jdbcType=DECIMAL}, |
|||
type = #{record.type,jdbcType=TINYINT}, |
|||
remark = #{record.remark,jdbcType=VARCHAR}, |
|||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|||
rec_status = #{record.recStatus,jdbcType=TINYINT} |
|||
<if test="_parameter != null"> |
|||
<include refid="Update_By_Example_Where_Clause" /> |
|||
</if> |
|||
</update> |
|||
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
update t_qcp_questionnaire_data_datum_line |
|||
<set> |
|||
<if test="name != null"> |
|||
name = #{name,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="datumLine != null"> |
|||
datum_line = #{datumLine,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="type != null"> |
|||
type = #{type,jdbcType=TINYINT}, |
|||
</if> |
|||
<if test="remark != null"> |
|||
remark = #{remark,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createdAt != null"> |
|||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="updatedAt != null"> |
|||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="recStatus != null"> |
|||
rec_status = #{recStatus,jdbcType=TINYINT}, |
|||
</if> |
|||
</set> |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
<update id="updateByPrimaryKey" parameterType="com.ccsens.carbasics.bean.po.QuestionnaireDataDatumLine"> |
|||
update t_qcp_questionnaire_data_datum_line |
|||
set name = #{name,jdbcType=VARCHAR}, |
|||
datum_line = #{datumLine,jdbcType=DECIMAL}, |
|||
type = #{type,jdbcType=TINYINT}, |
|||
remark = #{remark,jdbcType=VARCHAR}, |
|||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|||
rec_status = #{recStatus,jdbcType=TINYINT} |
|||
where id = #{id,jdbcType=BIGINT} |
|||
</update> |
|||
</mapper> |
Loading…
Reference in new issue