package org.jeecg.modules.orderplatform.mapper;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.orderplatform.entity.PlatformMaterial;

import java.util.List;

/**
 * 物料审批流程
 * @author: jeecg-boot
 * @date:   2020-11-10
 * @cersion: V1.0
 */
public interface PlatformMaterialMapper extends BaseMapper<PlatformMaterial> {

    List<JSONObject> queryMaterialsByDesignUserId(@Param("materialStatus") JSONArray materialStatus, @Param("designUserId") String designUserId);

    //代指派的物料
    List<JSONObject> queryMaterialsByDesignLeader(@Param("materialStatus") JSONArray materialStatus, @Param("designLeader") String designLeader);

    List<JSONObject> queryMaterialsByOperatorUserId(@Param("operatorUserId") String designUserId);

    JSONObject queryScriptDetailById(@Param("scriptId") String scriptId);

    JSONObject queryVideoDetailById(@Param("md5") String md5);

    PlatformMaterial queryByCode(@Param("materialCode") String materialCode);

    int queryCountByMaterialAndVideo(@Param("materialCode") String materialCode, @Param("videoMd5") String videoMd5);

    //查询物料相关人员
    JSONObject queryMaterialRelatePersonByMaterialCode(@Param("materialCode") String materialCode);

    //查询订单相关人员
    JSONObject queryOrderRelatePersonByMaterialCode(@Param("orderCode") String orderCode);

}
