Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public List<Map<String, Object>> staticCostByMonth(String year, String membername) {
   return recordDao.staticCostByMonth(year, membername);
 }
Exemplo n.º 3
0
 public List<Map<String, Object>> staticCostByDayAndMonth(String year, String month) {
   return recordDao.staticCostByDayAndMonth(year, month);
 }
Exemplo n.º 4
0
 public List<Map<String, Object>> staticTotalCostByPersonAndMonth(String year, String month) {
   return recordDao.staticTotalCostByPersonAndMonth(year, month);
 }
Exemplo n.º 5
0
 public boolean hasPreDayRecord(String date) {
   return recordDao.hasPreDayRecord(date);
 }
Exemplo n.º 6
0
 public CostRecord getById(Long id) {
   return recordDao.getById(CostRecord.class, id);
 }
Exemplo n.º 7
0
 public ArrayList statisticCostByDay(String year, String month) {
   return recordDao.statisticCostByDay(year, month);
 }
Exemplo n.º 8
0
 public Map<String, Object> dailyCosyByPerson(String year, String month, String user) {
   return recordDao.dailyCosyByPerson(year, month, user);
 }
Exemplo n.º 9
0
 public Map<String, Object> statisticPerson(String year, String month, String user) {
   return recordDao.statisticPerson(year, month, user);
 }
Exemplo n.º 10
0
 public Map<String, Object> monthTotal(String year, String month, String groupId) {
   return recordDao.monthTotal(year, month, groupId);
 }
Exemplo n.º 11
0
 public void updateRecord(CostRecord record) {
   recordDao.updateRecord(record);
 }
Exemplo n.º 12
0
 public void addRecord(CostRecord record) {
   recordDao.save(record);
 }
Exemplo n.º 13
0
 public List<CostRecord> getAll() {
   return recordDao.getAll();
 }