package com.ag.dynamicmodule.basecode.dao;

/**
 * Created by Administrator on 2019/9/23 0023.
 */

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

import java.util.List;

@Repository
public class CClientLinkmanDao {
    @Autowired
    SqlSessionTemplate sqlSessionTemplate;

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

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

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