package com.sifang.modules.sunshine.SystemSetting.dao;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.sunshine.SystemSetting.entity.CrmPlantForm;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.common.persistence.Parameter;
import org.springframework.stereotype.Repository;

/**
 * 公司资料设置---平台端维护 Dao
 */
@Repository
public class CompanyInformationDao extends BaseDao<CrmPlantForm> {
    /**
     * 获取公司资料设置信息
     * @return
     */
    public Record getCompanyAllData(String userId){
        StringBuffer sf = new StringBuffer();
        sf.append("SELECT p.* FROM crm_platform p WHERE p.`status`='0' and user_id=? limit 1 ");
        return Db.findFirst(sf.toString(),userId);
    }

    public CrmPlantForm getPlantForm(){
        // return getByHql("from CrmPlantForm a where a.status='0' and a.user_id=:p1 ",new Parameter(userId));
        return getByHql("from CrmPlantForm a where a.status='0' and user_id='1' ");
    }

}
