package com.sifang.modules.customer.dao;

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

import java.util.List;

@Repository
public class ComposePlanDao extends BaseDao<ComposePlan> {

    public List<Record> findPlanInfoEntryId(String entryId) {
        SqlBuilder builder = new SqlBuilder();
        builder.line("select c.plan_type_id, c.plan_type, p.code, p.name, p.attach, p.attach2,c.plan_id,c.project_id from crm_compose_plan c left join crm_plan p on c.plan_id = p.id where c.customer_entry_id = ?", entryId);
        return Db.find(builder.toString(), builder.params());
    }
}
