package com.ag.dynamicmodule.basecode.dao;

import com.ag.dynamicmodule.basecode.pojo.CClientInvoice;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2019/9/17 0017.
 */
@Repository
public class CClientInvoiceDao {
    @Autowired
    SqlSessionTemplate sqlSessionTemplate;

    /**
     * 新增数据
     * @param cClientInvoice
     * @return
     */
    public int insert(CClientInvoice cClientInvoice){
        return sqlSessionTemplate.insert("resources/basecode.CClientInvoiceMapper.insertSelective",cClientInvoice);
    }

    /**
     * 修改数据
     * @param cClientInvoice
     * @return
     */
    public int update(CClientInvoice cClientInvoice){
        return sqlSessionTemplate.update("resources/basecode.CClientInvoiceMapper.updateByPrimaryKeySelective",cClientInvoice);
    }

    /**
     * 查询CClientInvoice表数据
     * @param ids
     * @return
     */
    public List selectStudent(String ids){
        return sqlSessionTemplate.selectList("resources/basecode.CClientInvoiceMapper.selectStudent",ids);
    }
    /**
     * 删除CClientInvoice表数据
     * @param id
     * @return
     */
    public int delete(String clientCode){
        return  sqlSessionTemplate.delete("resources/basecode.CClientInvoiceMapper.deleteByClientCode",clientCode);
    }
}
