/*
 *      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.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.fjInfo.entity.FjInfoEntity;
import org.springblade.modules.rk.vo.LbVO;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.entity.RkxxEntity;
import org.springblade.modules.system.excel.FjxxExcel;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.excel.UserYhExcel;
import org.springblade.modules.system.vo.*;

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

/**
 * Mapper 接口
 *
 * @author Chill
 */
public interface UserMapper extends BaseMapper<User> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param user
	 * @param tenantId
	 * @return
	 */
	List<User> selectUserPage(IPage<User> page, String deptId, @Param("user") User user, @Param("tenantId") String tenantId);
	List<User> selectUserPage1(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId);

	/**
	 * 获取用户
	 *
	 * @param tenantId
	 * @param account
	 * @param password
	 * @return
	 */
	User getUser(String tenantId, String account, String password);

	/**
	 * 获取导出用户数据
	 *
	 * @param queryWrapper
	 * @return
	 */
	List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper);

    String getCodeByUsername(String username);

	String getUsernameByCode(String code);

	void updateCode(@Param("username") String username, @Param("code") String code);

    User selectUserIdByPhone(String xpmjlxdh);

    User selectUser(Long userId);

	List<LbVO> selectSq(Long userId);

    List<UserVO> getMjList(@Param("params") Map<String, Object> params);

    String getUsernameBySfzh(String sfzh);

    String getRoleId(String roleName);

	String getSqId(@Param("sqName") String sqName, @Param("pcsName") String pcsName, @Param("fjId") Long fjId);

	String getPcsId(@Param("pcsName") String pcsName, @Param("fjId") Long fjId);

    List<User> getUserList();

	void updateSfzh(User user);

    String getRoleName(String username);

	User getById(Long userId);

    void updateLastLoginTime(String username);

	String getZxxdSqId(String pcsDm);

	Long getIdByAccount(String account);

	User getUserNameById(Long createUser);

	boolean updateDeptId(@Param("userId") Long userId, @Param("ids") String ids);

	String getPcsIdByPcsName(@Param("pcsName") String pcsName, @Param("deptCategory") int deptCategory);

    SyBottomVO getSyBottom(String deptId);

	SyCenterVO getSyCenter(String deptId);

	SyCenterVO getSyCenterzs();

	SyTopVO getSyTop(String dept);

    User getByName(String cjr);

	User selectAccountByUserName(String username);

	PhVO getSyCenterPh(String deptId, String dept);

    List<GsdrsjbVO> getGsdrsjb(GsdrsjbVO gsdrsjbVO);

    List<UserYhExcel> getYhByCreateTime(User user,  @Param("deptIdList") List<Long> deptIdList);

    boolean qcCode(String id);

	String getPhone(Long id);

	Integer getPhoneXz(String phone);

    IPage<User> getFjgl(IPage<Object> page, User user);

    int getFjsl(Long id);

	List<ZdVO> getPcsFj(Dept dept);

	boolean updateFj(FjInfoEntity fjInfo, Long mjid);

	boolean updateUserFj(User user);

	List<FjInfoEntity> getFj(Long id);

	boolean deleteFj(Long id);

	List<FjxxExcel> exportFjxx(@Param("params") Map<String, Object> params);

    User selectMj(Long id);

	User selectMjPcs(Long id);

	void updateStatus();

	void zx(User user);

	SyCenterVO getSyCenterFwInfo(String deptId);

	SyCenterVO getSyCenterFwry(String deptId);

	SyCenterVO getSyCenterJxcs(String deptId);

	SyCenterVO getSyCenterCsjc(String deptId);

	SyCenterVO getSyCenterMdjf(String deptId);

	SyCenterVO getSyCenterYjjy(String deptId);

	SyCenterVO getSyCenterFwInfoZs();

	SyCenterVO getSyCenterFwryZs();

	SyCenterVO getSyCenterJxcsZs();

	SyCenterVO getSyCenterCsjcZs();

	SyCenterVO getSyCenterMdjfZs();

	SyCenterVO getSyCenterYjjyZs();

	Integer getFwzs(String deptId);

	Integer getSydwzs(String deptId);

	Integer getCzrk(String deptId);

	Integer getJzrk(String deptId);

	Integer getZzrk(String deptId);

	Integer getJwrk(String deptId);

	Integer getWlrk(String deptId);

	Integer getSwzdrzs(String deptId);

	Integer getTddxzs(String deptId);

	Integer getMdjfzs(String deptId);

	Integer getJxcszs(String deptId);

    RkxxEntity selectRyxxBySfzh(String sfzh);
}
