package org.jeecg.ctop.material.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.ctop.material.entity.SysManagerCompany;

import java.util.List;
import java.util.Map;

/**
 * 总经理&公司记录表
 *
 * @author jeecg-boot
 * 2022-02-22
 * @version V1.0
 */
public interface SysManagerCompanyMapper extends BaseMapper<SysManagerCompany> {

    List<JSONObject> queryDepartByParentId(@Param("designId") String designId);

    List<String> queryAllPersonnel(@Param("list") List<JSONObject> list);

    Long queryMaterialNumber(@Param("allPersonnel") List<String> allPersonnel, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<String> queryPersonnels(@Param("id") String id);

    double queryKsMaterialCharge(@Param("clipIds") List<String> clipIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userIds") List<String> userIds);

    Double queryTtMaterialCharge(@Param("clipIds") List<String> clipIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("userIds") List<String> userIds);

    List<JSONObject> queryTtProjectConsumeTop(@Param("companyId") String companyId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<JSONObject> queryKsProjectConsumeTop(@Param("companyId") String companyId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<Map<String, String>> getKsMonthlyData(@Param("companyId") String companyId, @Param("startTime") Integer startTime, @Param("endTime") String endTime);

    List<Map<String, String>> getTtMonthlyData(@Param("companyId") String companyId, @Param("startTime") Integer startTime, @Param("endTime") String endTime);

    JSONObject queryKsRealTimeCost(@Param("companyId") String companyId, @Param("today") String today, @Param("lastDay") String lastDay, @Param("hour") Integer hour);

    JSONObject queryKsRealTimeGroupNum(@Param("companyId") String companyId, @Param("today") String today, @Param("lastDay") String lastDay);

    JSONObject queryTtRealTimeMaterialNum(@Param("companyId") String companyId,@Param("userIds") List<String> userIds, @Param("today") String today, @Param("lastDay") String lastDay);

    JSONObject queryTtRealTimeCost(@Param("companyId") String companyId, @Param("today") String today, @Param("lastDay") String lastDay, @Param("hour") Integer hour);

    JSONObject queryTtRealTimeGroupNum(@Param("companyId") String companyId, @Param("today") String today, @Param("lastDay") String lastDay);

    JSONObject queryKsRealTimeMaterialNum(@Param("companyId") String companyId,@Param("userIds") List<String> userIds, @Param("today") String today, @Param("lastDay") String lastDay);

    String getKsTotalConsume(@Param("companyId") String companyId, @Param("startTime") Integer startTime, @Param("endTime") String endTime);

    String getTtTotalConsume(@Param("companyId") String companyId, @Param("startTime") Integer startTime, @Param("endTime") String endTime);
}
