public Page<CostRecord> selectListByPage(
     int currentPage, int pageSize, Map<String, String> params) {
   StringBuffer extraParams = new StringBuffer();
   if (StringUtils.isNotBlank(params.get("startTime"))) {
     extraParams.append(" and cr.costdate >= '" + params.get("startTime") + "' ");
   }
   if (StringUtils.isNotBlank(params.get("endTime"))) {
     extraParams.append(" and cr.costdate <= '" + params.get("endTime") + "' ");
   }
   if (StringUtils.isNotBlank(params.get("user")) && !"--请选择--".equals(params.get("user"))) {
     extraParams.append(" and cr.user = '******' ");
   }
   if (StringUtils.isNotBlank(params.get("costFor"))) {
     extraParams.append(" and cr.costFor like '%" + params.get("costFor") + "%' ");
   }
   StringBuffer baseHql =
       new StringBuffer(
           "from CostRecord cr where cr.deleted = 0 "
               + extraParams.toString()
               + " and cr.costGroup.id="
               + params.get("groupId")
               + " order by cr.costdate desc");
   Page<CostRecord> page = new Page<CostRecord>();
   page.setCurrentPage(currentPage);
   page.setPageSize(pageSize);
   page.setCustomizedHql(baseHql.toString());
   Page<CostRecord> resultPage = recordDao.selectByPage(page, CostRecord.class);
   return resultPage;
 }
 public List<Map<String, Object>> staticCostByMonth(String year, String membername) {
   return recordDao.staticCostByMonth(year, membername);
 }
 public List<Map<String, Object>> staticCostByDayAndMonth(String year, String month) {
   return recordDao.staticCostByDayAndMonth(year, month);
 }
 public List<Map<String, Object>> staticTotalCostByPersonAndMonth(String year, String month) {
   return recordDao.staticTotalCostByPersonAndMonth(year, month);
 }
 public boolean hasPreDayRecord(String date) {
   return recordDao.hasPreDayRecord(date);
 }
 public CostRecord getById(Long id) {
   return recordDao.getById(CostRecord.class, id);
 }
 public ArrayList statisticCostByDay(String year, String month) {
   return recordDao.statisticCostByDay(year, month);
 }
 public Map<String, Object> dailyCosyByPerson(String year, String month, String user) {
   return recordDao.dailyCosyByPerson(year, month, user);
 }
 public Map<String, Object> statisticPerson(String year, String month, String user) {
   return recordDao.statisticPerson(year, month, user);
 }
Example #10
0
 public Map<String, Object> monthTotal(String year, String month, String groupId) {
   return recordDao.monthTotal(year, month, groupId);
 }
Example #11
0
 public void updateRecord(CostRecord record) {
   recordDao.updateRecord(record);
 }
Example #12
0
 public void addRecord(CostRecord record) {
   recordDao.save(record);
 }
Example #13
0
 public List<CostRecord> getAll() {
   return recordDao.getAll();
 }