/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.csInfo.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.appmenu.vo.DbsxVO;
import org.springblade.modules.appmenu.vo.SssjVO;
import org.springblade.modules.csInfo.dto.TimeDTO;
import org.springblade.modules.csInfo.entity.CsInfoEntity;
import org.springblade.modules.csInfo.entity.CsRlb;
import org.springblade.modules.csInfo.excel.*;
import org.springblade.modules.csInfo.vo.CsInfoVO;
import org.springblade.modules.csInfo.vo.CsInfoVOS;
import org.springblade.modules.csInfo.vo.InfoVO;
import org.springblade.modules.csInfo.vo.TjfxVO;
import org.springblade.modules.sqjw.jwtdzrq.entity.JwtdZrqEntity;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.vo.DeptAllVO;

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

/**
 * 场所 Mapper 接口
 *
 * @author BladeX
 * @since 2023-07-21
 */
public interface CsInfoMapper extends BaseMapper<CsInfoEntity> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @return
	 */
	List<CsInfoVO> selectInfoPage(IPage page, @Param("params") Map<String, Object> params);
//	@InterceptorIgnore(tenantLine = "true")
	List<CsInfoVO> selectInfoPagePublic(IPage page, @Param("params") Map<String, Object> params);
	CsInfoEntity selectCsInfoByIdAndPcsbm(@Param("param")Map<String, Object> param);

	/**
	 * 获取导出数据
	 *
	 * @return
	 */
	List<CsInfoExcel> exportInfo(@Param("params") Map<String, Object> params);

    CsInfoVO getDetail(Long id);

	int getOverDue(@Param("params") Map<String, Object> params);

	int getXqzgTx(@Param("params") Map<String, Object> params);

    IPage<CsInfoEntity> selectCsPcs(IPage<Object> page, CsInfoEntity csInfo,String deptId,String str,String strEnd);

	List<CsInfoVOS> selectCsSq(Long id,String str,String strEnd);

	IPage<CsInfoEntity> selectCsxx(IPage<Object> page, CsInfoEntity csInfo);

	IPage<CsInfoEntity> selectSqByDeptname(IPage<Object> page, CsInfoEntity csInfo,String deptId,String str,String strEnd);

    DeptAllVO getParentInfo(Long sssqBm);

	List<Dept> getDeptList(@Param("params") Map<String, Object> params);

	List<QsJxcsExcel> getQsJxcs(IPage<QsJxcsExcel> page, @Param("params") Map<String, Object> params);

	List<QsJxcsExcel> exportQsJxcs(@Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> getSqTj(IPage<MjsjtjExcel> page, @Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> getPcsTj(IPage<MjsjtjExcel> page, @Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> getFjTj(IPage<MjsjtjExcel> page, @Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> getQsTj(IPage<MjsjtjExcel> page, @Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> exportSqTj(@Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> exportPcsTj(@Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> exportFjTj(@Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
	List<MjsjtjExcel> exportQsTj(@Param("params") Map<String, Object> params);

	List<TimeDTO> getXfjcTime(@Param("params") Map<String, Object> params);

	@InterceptorIgnore(tenantLine = "true")
    SssjVO getJxcs(@Param("params") Map<String, Object> params, String startTime, String endTime);

	@InterceptorIgnore(tenantLine = "true")
	SssjVO getXfjc(@Param("params") Map<String, Object> params, String startTime, String endTime);

	@InterceptorIgnore(tenantLine = "true")
	SssjVO getMdjf(@Param("params") Map<String, Object> params, String startTime, String endTime);

	@InterceptorIgnore(tenantLine = "true")
	SssjVO getRhzf(@Param("params") Map<String, Object> params, String startTime, String endTime);

	@InterceptorIgnore(tenantLine = "true")
	SssjVO getRhzfrs(@Param("params") Map<String, Object> params, String startTime, String endTime);

    DbsxVO getDbsxVOjc(String deptId);

	@InterceptorIgnore(tenantLine = "true")
	IPage<TjfxVO> getTjfxSjtj(IPage<TjfxVO> page, @Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	List<TjfxSjExcel> exportTjfxSjtj(@Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	IPage<TjfxVO> getTjfxFjtj(IPage<TjfxVO> page, @Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	List<TjfxFjExcel> exportTjfxFjtj(@Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	IPage<TjfxVO> getTjfxPcstj(IPage<TjfxVO> page, @Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	List<TjfxPcsExcel> exportTjfxPcstj(@Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	IPage<TjfxVO> getTjfxMjtj(IPage<TjfxVO> page, @Param("tjfxVO") TjfxVO tjfxVO);
	@InterceptorIgnore(tenantLine = "true")
	List<TjfxMjExcel> exportTjfxMjtj(@Param("tjfxVO") TjfxVO tjfxVO);

	CsInfoEntity getPublicCsInfo(long id);
	void addCsRl(CsRlb csRlb);
	void deleteByIds(String ids);
	void deleteRlIds(String ids);

    CsInfoEntity selectCsById(CsInfoEntity info);

	List<CsRlb> getRlByCszjAndPcsbm(@Param("param")Map<String, Object> param);

	boolean getJxcsXf(CsInfoEntity csInfoEntity);

	IPage<CsInfoEntity> getCsLb(IPage<CsInfoEntity> page, Long id, CsInfoEntity csInfoEntity);

	List<CsInfoEntity> selectSb(String[] csIds);

    IPage<CsInfoVO> getJxcsSc(IPage<Object> page, @Param("params") Map<String, Object> params);

	boolean getJxcsHf(String[] ids);

    CsInfoEntity selectShtyxydm(String tyxydm);

	boolean updateLastJcId(@Param("csId") Long csId, @Param("jcId") Long jcId);

    List<Long> getLdList(@Param("params") Map<String, Object> params);

	boolean csLdGl(@Param("ids") String[] ids, @Param("ldphxlh") String ldphxlh);

    boolean updateSspcs(String str, Long id, String deptName);

    boolean getQxgl(CsInfoEntity csInfoEntity);

	IPage<InfoVO> getDztj(IPage<InfoVO> page, String deptId);

	List<CsInfoVO> getDzxq(IPage<CsInfoVO> page, Map<String, Object> params);

	List<DztjExcel> exportDztj(@Param("param") Map<String, Object> dztj);

	int getJxcsSl(Long userId);

    JwtdZrqEntity getBySqBm(Long sssqbm);

	CsInfoEntity getTyxydm(String tyxydm);

	void deleteBySp(CsInfoEntity csInfoEntity);

	@DS("jl")
	void deleteBySpToJl(CsInfoEntity csInfoEntity);

    void hfDeleted(Long id);

	@DS("jl")
    void saveToJl(CsInfoEntity info);

	@DS("jl")
	void updateByIdToJl(CsInfoEntity csInfoEntity);

	int countBySqBm(@Param("params") Map<String, Object> params);
}
