package com.sifang.modules.customer.dao;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.customer.entity.CrmCustomerEntryProvinceLeaderInfo;
import com.sifang.modules.sys.common.persistence.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CrmCustomerEntryProvinceLeaderInfoDao extends BaseDao<CrmCustomerEntryProvinceLeaderInfo> {

    public boolean checkExist(String province) {
        return Db.queryLong(" select count(1) from crm_customer_entry_province_leader_info where  province = ?", province)>0;
    }

    public Record findByProvince(String province){
        return Db.findFirst(" select * from  crm_customer_entry_province_leader_info where province = ?",province);
    }

    public List<Record> findList(){
        return Db.find(" select * from crm_customer_entry_province_leader_info ");
    }
}
