package com.qianhe.zqbf.service.impl;

import com.qianhe.zqbf.domain.ZqbfXmzBfxm;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmQuery;
import com.qianhe.zqbf.domain.ZqbfXmzBfxmVo;
import com.qianhe.zqbf.mapper.ZqbfXmzBfxmMapper;
import com.qianhe.zqbf.service.ZqbfXmzBfxmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class ZqbfXmzBfxmServiceImpl implements ZqbfXmzBfxmService {
    @Autowired
    private ZqbfXmzBfxmMapper zqbfXmzBfxmMapper;


    /**
     * 条件查询
     */
    @Override
    public List<ZqbfXmzBfxmVo> list(ZqbfXmzBfxmQuery zqbfXmzBfxmQuery) {
        List<ZqbfXmzBfxmVo> dataList = zqbfXmzBfxmMapper.list(zqbfXmzBfxmQuery);
        return dataList;
    }

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

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

    /**
     * 修改
     */
    @Override
    public int edit(ZqbfXmzBfxm zqbfXmzBfxm, String username) {
        zqbfXmzBfxm.setGxr(username);
        return zqbfXmzBfxmMapper.edit(zqbfXmzBfxm);
    }

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