package com.xjrsoft.module.evaluate.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.xjrsoft.module.evaluate.entity.EvaluateManageItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

/**
* @title: 评价项
* @Author dzx
* @Date: 2024-01-16
* @Version 1.0
*/
@Mapper
public interface EvaluateManageItemMapper extends MPJBaseMapper<EvaluateManageItem> {

    @Insert("INSERT INTO evaluate_manage_item(id,create_user_id,create_date,delete_mark,enabled_mark,sort_code," +
            " evaluate_manage_id,topic,problem,score,input_not_null,evaluate_item_id) " +
            " SELECT CONCAT(id,RIGHT(#{evaluateManageId}, 5)),#{createUserId},NOW(),0,1,sort_code," +
            "#{evaluateManageId},topic,problem,score,input_not_null,id FROM evaluate_item" +
            " WHERE delete_mark = 0 AND evaluate_template_id = #{evaluateTemplateId}")
    Boolean cloneItems(Long evaluateTemplateId, Long evaluateManageId, Long createUserId);
}
