package com.example.demo.Service.impl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.demo.Domain.JavaObject.Page;
import com.example.demo.Domain.ViewObject.PersonalVO;
import com.example.demo.Domain.ParamterObject.PersonalCondition;
import com.example.demo.Domain.ReturnObject.TotalAmount;
import com.example.demo.Service.PersonalService;
import com.example.demo.MapperInterface.PersonalMapper;
@Service
public class PersonalServiceImpl implements PersonalService
{
@Autowired
private PersonalMapper PersonalMapperI; /** 定义私有映射对象 才能使用上该方法*/
@Override
public PersonalVO GetPageByCondition(Page PagePo, PersonalCondition Po, TotalAmount TotalAmountPo)
{
PersonalVO Personal_Vo = new PersonalVO();
if (TotalAmountPo.Total == 0) /** 首次 或条件重新刷新过*/
{
Personal_Vo.TotalAmountVo = PersonalMapperI.selectTotalByCondition(Po);
if (Personal_Vo.TotalAmountVo.Total == 0)
return null;
} else /**下一页 **/
{
if (PagePo.Is_RealTime) /** 实时统计**/
{
Personal_Vo.TotalAmountVo = PersonalMapperI.selectTotalByCondition(Po);
} else
{
Personal_Vo.TotalAmountVo = new TotalAmount();
Personal_Vo.TotalAmountVo.Total = TotalAmountPo.Total;
Personal_Vo.TotalAmountVo.Amount = TotalAmountPo.Amount;
}
}
Personal_Vo.PersonalListVo = PersonalMapperI.selectPageByCondition(PagePo.PageRows, PagePo.StartRows, Po);
return Personal_Vo;
}
}
package com.example.demo.Service.impl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.demo.Domain.JavaObject.Page;
import com.example.demo.Domain.ViewObject.PersonalVO;
import com.example.demo.Domain.ParamterObject.PersonalCondition;
import com.example.demo.Domain.ReturnObject.TotalAmount;
import com.example.demo.Service.PersonalService;
import com.example.demo.MapperInterface.PersonalMapper;
@Service
public class PersonalServiceImpl implements PersonalService
{
@Autowired
private PersonalMapper PersonalMapperI; /** 定义私有映射对象 才能使用上该方法*/
@Override
public PersonalVO GetPageByCondition(Page PagePo, PersonalCondition Po, TotalAmount TotalAmountPo)
{
PersonalVO Personal_Vo = new PersonalVO();
if (TotalAmountPo.Total == 0) /** 首次 或条件重新刷新过*/
{
Personal_Vo.TotalAmountVo = PersonalMapperI.selectTotalByCondition(Po);
if (Personal_Vo.TotalAmountVo.Total == 0)
return null;
} else /**下一页 **/
{
if (PagePo.Is_RealTime) /** 实时统计**/
{
Personal_Vo.TotalAmountVo = PersonalMapperI.selectTotalByCondition(Po);
} else
{
Personal_Vo.TotalAmountVo = new TotalAmount();
Personal_Vo.TotalAmountVo.Total = TotalAmountPo.Total;
Personal_Vo.TotalAmountVo.Amount = TotalAmountPo.Amount;
}
}
Personal_Vo.PersonalListVo = PersonalMapperI.selectPageByCondition(PagePo.PageRows, PagePo.StartRows, Po);
return Personal_Vo;
}
}