|
@ -46,49 +46,53 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
private IotCompanyAppInterfaceDao iotCompanyAppInterfaceDao;
|
|
private IotCompanyAppInterfaceDao iotCompanyAppInterfaceDao;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*分页查找
|
|
|
|
* @param page
|
|
|
|
* @param size
|
|
|
|
* @param accountType
|
|
|
|
* @param enterType
|
|
|
|
* @return
|
|
|
|
* @throws ParseException
|
|
|
|
*/
|
|
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> queryPage(Integer page, Integer size, String accountType, String enterType) throws ParseException {
|
|
|
|
String filters = "del=1;";
|
|
|
|
String semicolon = "";
|
|
|
|
if(StringUtils.isNotBlank(accountType)){
|
|
|
|
filters += "accountType?"+accountType;
|
|
|
|
semicolon = ";";
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(enterType)){
|
|
|
|
filters += semicolon +"enterType="+enterType;
|
|
|
|
semicolon = ";";
|
|
|
|
}
|
|
|
|
String sorts = "-updateTime";//按更新时间降序
|
|
|
|
List<IotCompanyDO> list = search(null, filters, sorts, page, size);
|
|
|
|
|
|
|
|
if(accountType.equalsIgnoreCase("1")){
|
|
|
|
//得到list数据
|
|
|
|
list.forEach(one->{
|
|
|
|
findType(one);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if(accountType.equalsIgnoreCase("0")){
|
|
|
|
list.forEach(one->{
|
|
|
|
findAppType(one);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取总数
|
|
|
|
long count = getCount(filters);
|
|
|
|
|
|
|
|
//DO转VO
|
|
|
|
List<IotCompanyVO> iotCompanyVOList = convertToModelVOs(list,new ArrayList<>(list.size()));
|
|
|
|
|
|
|
|
return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,iotCompanyVOList, page, size,count);
|
|
|
|
}
|
|
|
|
|
|
// /**
|
|
|
|
// *分页查找
|
|
|
|
// * @param page
|
|
|
|
// * @param size
|
|
|
|
// * @param accountType
|
|
|
|
// * @param enterType
|
|
|
|
// * @return
|
|
|
|
// * @throws ParseException
|
|
|
|
// */
|
|
|
|
// public MixEnvelop<IotCompanyVO, IotCompanyVO> queryPage(Integer page, Integer size,String companyName, String accountType, String enterType) throws ParseException {
|
|
|
|
// String filters = "del=1;";
|
|
|
|
// String semicolon = "";
|
|
|
|
// if(StringUtils.isNotBlank(accountType)){
|
|
|
|
// filters += "accountType?"+accountType;
|
|
|
|
// semicolon = ";";
|
|
|
|
// }
|
|
|
|
// if (StringUtils.isNotBlank(companyName)){
|
|
|
|
// filters+="name?"+companyName;
|
|
|
|
// semicolon = ";";
|
|
|
|
// }
|
|
|
|
// if(StringUtils.isNotBlank(enterType)){
|
|
|
|
// filters += semicolon +"enterType="+enterType;
|
|
|
|
// semicolon = ";";
|
|
|
|
// }
|
|
|
|
// String sorts = "-updateTime";//按更新时间降序
|
|
|
|
// List<IotCompanyDO> list = search(null, filters, sorts, page, size);
|
|
|
|
//
|
|
|
|
// if(accountType.equalsIgnoreCase("1")){
|
|
|
|
// //得到list数据
|
|
|
|
// list.forEach(one->{
|
|
|
|
// findType(one);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// if(accountType.equalsIgnoreCase("0")){
|
|
|
|
// list.forEach(one->{
|
|
|
|
// findAppType(one);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// //获取总数
|
|
|
|
// long count = getCount(filters);
|
|
|
|
//
|
|
|
|
// //DO转VO
|
|
|
|
// List<IotCompanyVO> iotCompanyVOList = convertToModelVOs(list,new ArrayList<>(list.size()));
|
|
|
|
//
|
|
|
|
// return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,iotCompanyVOList, page, size,count);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -100,7 +104,7 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
* @param enterType
|
|
* @param enterType
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> queryPage(Integer page, Integer size, String status, String accountType, String enterType){
|
|
|
|
|
|
public MixEnvelop<IotCompanyVO, IotCompanyVO> queryPage(Integer page, Integer size,String companyName, String status, String accountType, String enterType){
|
|
StringBuffer sql = new StringBuffer("SELECT DISTINCT c.* from iot_company c WHERE c.del=1 ");
|
|
StringBuffer sql = new StringBuffer("SELECT DISTINCT c.* from iot_company c WHERE c.del=1 ");
|
|
StringBuffer sqlCount = new StringBuffer("SELECT COUNT(DISTINCT c.id) count from iot_company c WHERE c.del=1 ");
|
|
StringBuffer sqlCount = new StringBuffer("SELECT COUNT(DISTINCT c.id) count from iot_company c WHERE c.del=1 ");
|
|
List<Object> args = new ArrayList<>();
|
|
List<Object> args = new ArrayList<>();
|
|
@ -114,6 +118,10 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
sqlCount.append(" and c.account_type='").append(accountType).append("' ");
|
|
sqlCount.append(" and c.account_type='").append(accountType).append("' ");
|
|
args.add(accountType);
|
|
args.add(accountType);
|
|
}
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(companyName)){
|
|
|
|
sql.append(" and (c.name like '%").append(companyName).append("%')");
|
|
|
|
sqlCount.append(" and (c.name like '%").append(companyName).append("%')");
|
|
|
|
}
|
|
if(StringUtils.isNotBlank(enterType)){
|
|
if(StringUtils.isNotBlank(enterType)){
|
|
sql.append(" and c.enter_type=? ");
|
|
sql.append(" and c.enter_type=? ");
|
|
sqlCount.append(" and c.enter_type='").append(enterType).append("' ");
|
|
sqlCount.append(" and c.enter_type='").append(enterType).append("' ");
|