package org.jeecg.modules.adweb.workflow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.jeecg.modules.adweb.workflow.entity.ExecuteNode;

/**
 * @Description: adweb_execute_node @Author: jeecg-boot @Date: 2021-11-12 @Version: V1.0
 */
public interface ExecuteNodeMapper extends BaseMapper<ExecuteNode> {

  /** 拷贝流程-审核询盘 @Author: chenpeiqing @Date: 2025/03/24 */
  @Insert(
      "INSERT INTO adweb_execute_node ( type, host_id, node_type, NAME, time_desc, description, proportion, sort, STATUS, fin_time, fin_uid, del_flag, create_time ) \n"
          + "SELECT\n"
          + "\t2 type,\n"
          + "\t'${enquiryId}' host_id,\n"
          + "\t4 node_type,\n"
          + "\tNAME,\n"
          + "\ttime_desc,\n"
          + "\tdescription,\n"
          + "\tproportion,\n"
          + "\tsort,\n"
          + "\t0 `status`,\n"
          + "\tfin_time,\n"
          + "\tfin_uid,\n"
          + "\tdel_flag,\n"
          + "\tNOW() create_time \n"
          + "FROM\n"
          + "\tadweb_execute_node \n"
          + "WHERE\n"
          + "\thost_id = #{hostId} \n"
          + "\tAND del_flag = 0")
  void copyEnquiryVerifyFlow(String enquiryId, String hostId);

  /** 拷贝流程-创建站点 @Author: luxiaoxiao @Date: 2021/11/15 */
  @Insert(
      "INSERT INTO adweb_execute_node ( type, host_id, node_type, NAME, time_desc, description, proportion, sort, STATUS, fin_time, fin_uid, del_flag, create_time ) \n"
          + "SELECT\n"
          + "\t2 type,\n"
          + "\t'${siteCode}' host_id,\n"
          + "\t1 node_type,\n"
          + "\tNAME,\n"
          + "\ttime_desc,\n"
          + "\tdescription,\n"
          + "\tproportion,\n"
          + "\tsort,\n"
          + "\t0 `status`,\n"
          + "\tfin_time,\n"
          + "\tfin_uid,\n"
          + "\tdel_flag,\n"
          + "\tNOW() create_time \n"
          + "FROM\n"
          + "\tadweb_execute_node \n"
          + "WHERE\n"
          + "\thost_id = #{hostId} \n"
          + "\tAND del_flag = 0")
  void copySiteFlow(String siteCode, String hostId);
}
