DPersonReceptionDao.java 1.11 KB
package com.viontech.keliu.dao;

import cn.hutool.core.date.DateUtil;
import com.viontech.keliu.entity.DPersonReception;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: zhuhai
 * Date: 2023-12-23
 * Time: 15:51
 */
@Repository
public class DPersonReceptionDao {

    @Resource
    private JdbcTemplate jdbcTemplate;


    public List<DPersonReception> getPersonReceptionList(Long mallId, Date countDate, String personUnid, Date startTime, Date endTime) {
        startTime = DateUtil.offsetMinute(startTime, -5);
        endTime = DateUtil.offsetMinute(endTime, 5);
        String sql  = "select * from d_person_reception where mall_id = ? and count_date = ? and person_unid = ? and start_time >= ? and end_time <= ? order by start_time;";
        return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(DPersonReception.class), mallId, countDate, personUnid, startTime, endTime);
    }
}