Commit f0e48c5d authored by liuna's avatar liuna

2017年12月21日 智能分析平台提交内容

--增加省份带有全国字段的实体
parent b7da7ec1
package com.hp.cmsz.entity;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
* dim_province_all_info_t表对应的实体类
*
*
*
*/
@Entity
@Table(name = "dim_province_all_info_t")
public class ProvinceAll implements Serializable{
private Long provinceId;//省份ID
private String provinceName;//省份名称
private String provinceCode;//省份编码
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ProvinceSequence")
@SequenceGenerator(name = "ProvinceSequence", sequenceName = "dim_province_info_t_seq", allocationSize=1)
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
}
\ No newline at end of file
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.ProvinceAll;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface ProvinceAllDao extends JpaSpecificationExecutor<ProvinceAll>,
PagingAndSortingRepository<ProvinceAll, Long> {
List<ProvinceAll> findByProvinceName(String provinceName);
List<ProvinceAll> findByProvinceIdIn(List<Long> provinceIds);
List<ProvinceAll> findByProvinceId(Long provinceId);
@Query("from ProvinceAll p where p.provinceId>=0 order by p.provinceId")
List<ProvinceAll> findProvince();
}
......@@ -25,10 +25,10 @@ public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRule
QualityRuleInfo findByQualityRuleId(Long qualityRuleId);
//根据筛选项查找
Page<QualityRuleInfo> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeInAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province, List<Long> ifFilter,List<String> ifWarning,Timestamp startTime, Timestamp endTime,Pageable pageable);
Page<QualityRuleInfo> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeIsNotAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province, List<Long> ifFilter,String ifWarning,Timestamp startTime, Timestamp endTime,Pageable pageable);
//List<QualityRuleInfo> findByProvinceIdAndKpiIdAndWarningTypeIsNotAndBusinessTimeBetween(Long provinceId, Long kpiId,String type, Timestamp startTime, Timestamp endTime);
List<QualityRuleInfo> findByProvinceIdAndKpiIdAndWarningTypeIsNotAndBusinessTimeBetween(Long provinceId, Long kpiId,String type, Timestamp startTime, Timestamp endTime);
List<QualityRuleReport> findByProvinceIdAndKpiIdAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime);
// List<QualityRuleReport> findByProvinceIdAndKpiIdAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime);
}
package com.hp.cmsz.service;
import java.util.List;
import com.hp.cmsz.entity.ProvinceAll;
import com.hp.cmsz.repository.ProvinceAllDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.YwglTagDao;
/**
*
*
*/
@Component
@Transactional(readOnly = true)
public class ProvinceAllService {
@Autowired
private ProvinceAllDao provinceAllDao;
@Autowired
private YwglTagDao ywglTagDao;
public long getProvinceSize() {
return provinceAllDao.count();
}
public List<ProvinceAll> getProvinceList() {
return (List<ProvinceAll>) provinceAllDao.findAll();
}
//业务规律省份地市 author Sophia
public List<Object[]> getCityByProvince(List<Long> pro){
return (List<Object[]>) ywglTagDao.findCityByProvince(pro);
}
//有省份ID号得到省份的名称
public String getProvinceNameByProvinceIds(List<Long> provinceIds){
List<ProvinceAll> provinces = provinceAllDao.findByProvinceIdIn(provinceIds);
String provinceStr="";
for(int i=0;i<provinces.size();i++){
if(i==(provinces.size()-1)){
provinceStr += provinces.get(i).getProvinceName();
}
else{
provinceStr += provinces.get(i).getProvinceName()+" ";
}
}
return provinceStr;
}
}
......@@ -39,20 +39,20 @@ public class QualityRuleInfoService {
}
//根据筛选项获取质量规则
public Page<QualityRuleInfo> getQualityRuleInfoBy(QualityRuleInfo qualityRuleInfo,int pageNumber, int pageSize, String sortType,List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province, List<Long> ifFilter,List<String> ifWarning,Timestamp startTime, Timestamp endTime){
public Page<QualityRuleInfo> getQualityRuleInfoBy(QualityRuleInfo qualityRuleInfo,int pageNumber, int pageSize, String sortType,List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province, List<Long> ifFilter,String ifWarning,Timestamp startTime, Timestamp endTime){
PageRequest pageRequest = buildPageRequest(pageNumber, pageSize, sortType, "qualityRuleId");
return qualityRuleInfoDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeInAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(dataSource,chnnal,busines,province,ifFilter,ifWarning,startTime, endTime,pageRequest);
return qualityRuleInfoDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeIsNotAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(dataSource,chnnal,busines,province,ifFilter,ifWarning,startTime, endTime,pageRequest);
}
// //根据省份ID、指标ID和业务时间查询质量规则运营明细
// public List<QualityRuleInfo> findBy(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime){
// return qualityRuleInfoDao.findByProvinceIdAndKpiIdAndWarningTypeIsNotAndBusinessTimeBetween(provinceId,kpiId,"正常",startTime,endTime);
// }
public List<QualityRuleReport> findBy(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime){
return qualityRuleInfoDao.findByProvinceIdAndKpiIdAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(provinceId,kpiId,startTime,endTime);
//根据省份ID、指标ID和业务时间查询质量规则运营明细
public List<QualityRuleInfo> findBy(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime){
return qualityRuleInfoDao.findByProvinceIdAndKpiIdAndWarningTypeIsNotAndBusinessTimeBetween(provinceId,kpiId,"正常",startTime,endTime);
}
// public List<QualityRuleReport> findBy(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime){
// return qualityRuleInfoDao.findByProvinceIdAndKpiIdAndBusinessTimeBetweenOrderByBusinessTimeDescProvinceIdDescWarningNumAsc(provinceId,kpiId,startTime,endTime);
// }
/**
* 创建分页请求.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment