package com.qianhe.zqbfbdw.bfzj.service.impl;

import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzj;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjQuery;
import com.qianhe.zqbfbdw.bfzj.domain.ZqbfBdwBfzjVo;
import com.qianhe.zqbfbdw.bfzj.mapper.ZqbfBdwBfzjMapper;
import com.qianhe.zqbfbdw.bfzj.service.ZqbfBdwBfzjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ZqbfBdwBfzjServiceImpl implements ZqbfBdwBfzjService {
    @Autowired
    private ZqbfBdwBfzjMapper zqbfBdwBfzjMapper;


    /**
     * 条件查询
     */
    @Override
    public List<ZqbfBdwBfzjVo> list(ZqbfBdwBfzjQuery zqbfBdwBfzjQuery) {
        List<ZqbfBdwBfzjVo> dataList = zqbfBdwBfzjMapper.list(zqbfBdwBfzjQuery);
        return dataList;
    }

    /**
     * 查询详情
     */
    @Override
    public ZqbfBdwBfzjVo info(Long id) {
        ZqbfBdwBfzjVo info = zqbfBdwBfzjMapper.info(id);
        return info;
    }

    /**
     * 新增
     */
    @Override
    public int add(ZqbfBdwBfzj zqbfBdwBfzj, String username) {
        zqbfBdwBfzj.setCjr(username);
        zqbfBdwBfzj.setCjsj(new Date());
        zqbfBdwBfzj.setGxr(username);
        return zqbfBdwBfzjMapper.add(zqbfBdwBfzj);
    }

    /**
     * 修改
     */
    @Override
    public int edit(ZqbfBdwBfzj zqbfBdwBfzj, String username) {
        zqbfBdwBfzj.setGxr(username);
        return zqbfBdwBfzjMapper.edit(zqbfBdwBfzj);
    }

    /**
     * 删除
     */
    @Override
    public int delete(Long[] ids) {
        return zqbfBdwBfzjMapper.delete(ids);
    }
}
