Commit 820915cc by manxiaoqiang

app排序

parent 5a011dbb
......@@ -135,8 +135,8 @@ public class ContractController {
@RequestMapping(value = "checkAccount", method = RequestMethod.GET)
@ResponseBody
public ResultModel checkAccount(@CurrentAccount User loginAccount, @RequestParam String email) {
return ResultModel.OK(service.checkAccount(email));
public ResultModel checkAccount(@CurrentAccount User loginAccount, @RequestParam String email, @PathVariable String platform) {
return ResultModel.OK(service.checkAccount(email, platform));
}
@RequestMapping(value = "find/body", method = RequestMethod.GET)
......
......@@ -15,8 +15,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query(value="select count(*) from contract where ds = ?1",nativeQuery=true)
BigInteger countNumByDs(String ds);
@Query(value="select count(*) from contract where email = ?1",nativeQuery=true)
BigInteger countNumByEmail(String email);
@Query(value="select count(*) from contract where email = ?1 and platform = ?2",nativeQuery=true)
BigInteger countNumByEmail(String email, String platfrom);
@Query(value="select * from contract where ds >= ?1 and ds <= ?2 and platform = ?3 order by ds desc",nativeQuery=true)
List<Contract> findByDs(String startDate, String endDate, String platfrom);
......
......@@ -11,7 +11,7 @@ import java.util.Map;
*/
public interface ContractService {
Map<String, Object> checkAccount(String email);
Map<String, Object> checkAccount(String email, String platfrom);
List<ContractBody> findBody();
......
......@@ -42,13 +42,13 @@ public class ContractServiceImpl implements ContractService{
AccountService accountService;
@Override
public Map<String, Object> checkAccount(String email) {
public Map<String, Object> checkAccount(String email, String platfrom) {
Map<String, Object> map = new HashMap<>();
Account4Web account4Web = account4WebRepository.findByEmail(email);
if(null == account4Web){
map.put("result", 0);
}else{
BigInteger integer = contractRepository.countNumByDs(DateUtil.getBeforeDays(0));
BigInteger integer = contractRepository.countNumByEmail(email,platfrom);
map.put("result", 1);
map.put("company", account4Web.getCompany());
map.put("num", integer.intValue());
......
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