package com.sifang.modules.setting.dao;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.setting.entity.EntryProcessSet;
import com.sifang.modules.sys.common.persistence.BaseDao;
import com.sifang.modules.sys.util.SqlBuilder;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author DQChen
 * @date 2024-02-02 16:10
 */
@Repository
public class EntryProcessSetDao extends BaseDao<EntryProcessSet> {

	public List<Record> selectProcessSetListForPartner(String partnerId) {
		SqlBuilder sb = new SqlBuilder();
		sb.line("select a.id,a.stage,a.name,b.must_flag,a.way,a.operate_name,ifnull(b.status,'1') as status");
		sb.line("from crm_entry_process_set a");
		sb.line("left join crm_entry_process_partner_set b on a.id=b.process_set_id and b.partner=?", partnerId);
		sb.line("where a.is_show='1'");
		sb.line("order by a.sort asc");
		return Db.find(sb.build(), sb.params());
	}


}
