package com.liang.service.impl;

import com.liang.entity.StaTempmember;
import com.liang.dao.StaTempmemberDao;
import com.liang.service.StaTempmemberService;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 项目人员（主要完成人）(StaTempmember)表服务实现类
 *
 * @author makejava
 * @since 2023-07-03 16:32:44
 */
@Service("staTempmemberService")
public class StaTempmemberServiceImpl implements StaTempmemberService {
    @Resource
    private StaTempmemberDao staTempmemberDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public StaTempmember queryById(Integer id) {
        return this.staTempmemberDao.queryById(id);
    }

    /**
     * 分页查询
     *
     * @param staTempmember 筛选条件
     * @param pageRequest   分页对象
     * @return 查询结果
     */
    @Override
    public Page<StaTempmember> queryByPage(StaTempmember staTempmember, PageRequest pageRequest) {
        long total = this.staTempmemberDao.count(staTempmember);
        return new PageImpl<>(this.staTempmemberDao.queryAllByLimit(staTempmember, pageRequest), pageRequest, total);
    }

    @Override
    public int batchDeleteByZb(int zb) {
        return this.staTempmemberDao.batchDeleteByZb(zb);
    }

    /**
     * 新增数据
     *
     * @param staTempmember 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(StaTempmember staTempmember) {
        return this.staTempmemberDao.insert(staTempmember);
    }

    /**
     * 修改数据
     *
     * @param staTempmember 实例对象
     * @return 实例对象
     */
    @Override
    public int update(StaTempmember staTempmember) {
        return this.staTempmemberDao.update(staTempmember);
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.staTempmemberDao.deleteById(id) > 0;
    }

    @Override
    public int insertBatch(List<StaTempmember> memberList) {

        return this.staTempmemberDao.insertBatch(memberList);
    }

    @Override
    public List<StaTempmember> getMemberList(Map map) {
        return this.staTempmemberDao.getMemberList(map);
    }

    @Override
    public int batchDeleteByFysq(List<Integer> fysqList) {
        return this.staTempmemberDao.batchDeleteByFysq(fysqList);
    }

    @Override
    public StaTempmember getTempMember(Map map) {
        return this.staTempmemberDao.getTempMember(map);
    }

    @Override
    public List<StaTempmember> getLSList(Integer zb) {
        return this.staTempmemberDao.getLSList(zb);
    }

    @Override
    public List<HashMap<String, Object>> getAllTemeMemberCost() {
        return this.staTempmemberDao.getAllTemeMemberCost();
    }

    @Override
    public List<HashMap<String, Object>> searchTemeMemberCost(Map map) {
        return this.staTempmemberDao.searchTemeMemberCost(map);
    }

    @Override
    public StaTempmember getXm(Map map) {
        return this.staTempmemberDao.getXm(map);
    }

    @Override
    public List<StaTempmember> getAlls(Map map) {
        return this.staTempmemberDao.getAlls(map);
    }


}

