package com.sdtool.business.dao;

import com.sdtool.common.entity.site.ERPUploadFile;
import com.sdtool.common.entity.site.SiteContent;
import com.sdtool.common.entity.system.*;
import com.dySweetFishPlugin.sql.dao.*;
import com.sweetfish.source.PageFlipper;
import org.rex.RMap;

import java.util.List;

/**
 * Created by jlutt on 2020-07-29
 *
 * @author jlutt
 */
@SuppressWarnings({"rawtypes", "UnusedReturnValue"})
public interface SystemDao extends DaoRepository {

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "login", table = "tbUser", params = {1})
    LoginUser login(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "getUserInfo", table = "tbUser", params = {1})
    LoginUser getUserInfo(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryLoginUsers", table = "tbUser,tbDept", params = {1})
    List<LoginUser> queryLoginUsers(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    //注意mysql select count 返回的是long类型，不能像sql server用int做返回值
    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "accountExists", table = "tbUser", params = {1})
    long accountExists(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertLoginUser", table = "tbUser", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "insertUserRole", table = "tbUserRole", params = {2}, sort = 2)
    int addLoginUser(LoginUser userInfo, List<UserRole> roleList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertLoginUser", table = "tbUser", params = {1}, sort = 1)
    int addLoginUser2(LoginUser userInfo, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateLoginUser", table = "tbUser", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "clearUserRole", table = "tbUserRole", params = {2}, sort = 2)
    @SqlId(clazz = SystemDao.class, sql = "insertUserRole", table = "tbUserRole", params = {3}, sort = 3)
    int updateLoginUser(LoginUser userInfo, RMap params, List<UserRole> roleList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "clearUserRole", table = "tbUserRole", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "insertUserRole", table = "tbUserRole", params = {2}, sort = 2)
    int configLoginUserRole(RMap params, List<UserRole> roleList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateLoginUser", table = "tbUser", params = {1}, sort = 1)
    int updateLoginUser2(LoginUser userInfo, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidLoginUser", table = "tbUser", params = {1})
    int voidLoginUser(LoginUser userInfo, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "resetLoginUser", table = "tbUser", params = {1})
    int resetLoginUser(LoginUser userInfo, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "changeMyPassword", table = "tbUser", params = {1})
    int changeMyPassword(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryAllMenus", table = "tbMenu", params = {1})
    List<Menu> queryAllMenus(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryAllRoles", table = "tbRole", params = {1})
    List<Role> queryAllRoles(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryRoleMenus", table = "tbRoleMenu,tbMenu", params = {1})
    List<RoleMenu> queryRoleMenus(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryRoleActions", table = "tbRoleMenu,tbMenu", params = {1})
    List<RoleMenu> queryRoleActions(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryUserRoles", table = "tbUserRole", params = {1})
    List<UserRole> queryUserRoles(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryMenuRoles", table = "tbRoleMenu,tbRole", params = {1})
    List<Role> queryMenuRoles(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryRoleUsers", table = "tbUserRole,tbUser", params = {1})
    List<LoginUser> queryRoleUsers(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryAllDepts", table = "tbDept", params = {1})
    List<Dept> queryAllDepts(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addDept", table = "tbDept", params = {1})
    int addDept(Dept dept, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateDept", table = "tbDept", params = {1})
    int updateDept(Dept dept, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidDept", table = "tbDept", params = {1})
    int voidDept(Dept dept, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertMenu", table = "tbMenu", params = {1})
    int addMenu(Menu menu, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateMenu", table = "tbMenu", params = {1})
    int updateMenu(Menu menu, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidMenu", table = "tbMenu", params = {1})
    int voidMenu(Menu menu, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.SYNC)
    @SqlId(clazz = SystemDao.class, sql = "deleteRoleMenu", table = "tbRoleMenu", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "deleteMenu", table = "tbMenu", params = {1}, sort = 2)
    int deleteMenu(RMap menu, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryAllRoles", table = "tbRole", params = {1})
    List<Role> selectRolePage(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertRole", table = "tbRole", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "insertRoleMenu", table = "tbRoleMenu", params = {2}, sort = 2)
    int addRole(Role role, List<RoleMenu> menuList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateRole", table = "tbRole", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "clearRoleMenu", table = "tbRoleMenu", params = {2}, sort = 2)
    @SqlId(clazz = SystemDao.class, sql = "insertRoleMenu", table = "tbRoleMenu", params = {3}, sort = 3)
    int updateRole(Role role, RMap params, List<RoleMenu> menuList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidRole", table = "tbRole", params = {1})
    int voidRole(Role role, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertERPFile", table = "tbERPUploadFile", params = {1}, sort = 1)
    int insertERPFile(ERPUploadFile erpUploadFile, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    //region 系统配置

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryAllConfig", table = "tbConfigValue", params = {1})
    List<ConfigValue> queryAllConfigValues(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, cache = true, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryConfig", table = "tbConfigValue", params = {1})
    ConfigValue queryConfigValue(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertConfigValue", table = "tbConfigValue", params = {1})
    int addConfigValue(ConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.SYNC)
    @SqlId(clazz = SystemDao.class, sql = "insertConfigValue", table = "tbConfigValue", params = {1})
    int addConfigValueSync(ConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateConfigValue", table = "tbConfigValue", params = {1})
    int updateConfigValue(ConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateOnlyConfigValue", table = "tbConfigValue", params = {1})
    int updateBatchConfigValue(List<ConfigValue> valueList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "deleteConfigValue", table = "tbConfigValue", params = {1})
    int deleteConfigValue(ConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    //endregion

    //region 字典管理

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryDictTypes", table = "tbDictType", params = {1})
    List<DictType> queryDictTypes(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier, PageFlipper pageFlipper);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addDictType", table = "tbDictType", params = {1})
    int addDictType(DictType dictType, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateDictType", table = "tbDictType", params = {1})
    int updateDictType(DictType dictType, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidDictType", table = "tbDictType", params = {1})
    int voidDictType(DictType dictType, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryDictDatas", table = "tbDictData", params = {1})
    List<DictData> queryDictDatas(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier, PageFlipper pageFlipper);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addDictData", table = "tbDictData", params = {1})
    int addDictData(DictData dictData, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateDictData", table = "tbDictData", params = {1})
    int updateDictData(DictData dictData, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidDictData", table = "tbDictData", params = {1})
    int voidDictData(DictData dictData, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    //endregion

    //region 消息类型

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectAllNoticeMessage", table = "tbNoticeMessage", params = {1})
    List<NoticeMessage> selectAllNoticeMessage(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addNoticeMessage", table = "tbNoticeMessage", params = {1})
    int addNoticeMessage(NoticeMessage noticeMessage, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateNoticeMessage", table = "tbNoticeMessage", params = {1})
    int updateNoticeMessage(NoticeMessage noticeMessage, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidNoticeMessage", table = "tbNoticeMessage", params = {1})
    int voidNoticeMessage(NoticeMessage noticeMessage, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectUserNoticeMessage", table = "tbUserNoticeMessage,tbNoticeMessage", params = {1})
    List<UserNoticeMessage> selectUserNoticeMessage(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addUserNoticeMessage", table = "tbUserNoticeMessage", params = {1})
    int addUserNoticeMessage(UserNoticeMessage userNoticeMessage, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "deleteNoticeMessage", table = "tbUserNoticeMessage", params = {1})
    int deleteNoticeMessage(UserNoticeMessage userNoticeMessage, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);


    //endregion

    //region 个人配置

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "queryPersonConfigValue", table = "tbPersonConfigValue", params = {1})
    List<PersonConfigValue> queryPersonConfigValue(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addPersonConfigValue", table = "tbPersonConfigValue", params = {1}, sort = 1)
    int addPersonConfigValue(PersonConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updatePersonConfigValue", table = "tbPersonConfigValue", params = {1}, sort = 1)
    int updatePersonConfigValue(PersonConfigValue configValue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    //endregion

    //region 数据权限

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectDataPurview", table = "tbDataPurview", params = {1})
    List<DataPurview> selectDataPurview(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addDataPurview", table = "tbDataPurview", params = {1})
    int addDataPurview(List<DataPurview> dataPurviewList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "deleteDataPurview", table = "tbDataPurview", params = {1})
    int deleteDataPurview(List<DataPurview> dataPurviewList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    //endregion

    //region 导出任务

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.SYNC)
    @SqlId(clazz = SystemDao.class, sql = "insertTaskQueue", table = "tbTaskQueue", params = {1}, sort = 1)
    int saveTaskQueue(TaskQueue taskQueue, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectTaskQueue", table = "tbTaskQueue", params = {1})
    List<TaskQueue> selectTaskQueue(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    //endregion

    //region 页面表格列

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "deletePageTableColumn", table = "tbPageTableColumn", params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "insertPageTableColumn", table = "tbPageTableColumn", params = {2}, sort = 2)
    int savePageTableColumn(RMap deleteParams, List<PageTableColumn> columnList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectPageTableColumn", table = "tbPageTableColumn", params = {1}, sort = 1)
    List<PageTableColumn> selectPageTableColumn(RMap deleteParams, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    //endregion

    //region 系统公告
    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertAnnouncement", table = "tbAnnouncement", tableParam = 4, params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "insertAnnouncementAttachment", table = "tbAnnouncementAttachment", tableParam = 4, params = {2}, sort = 2)
    int insertAnnouncement(Announcement announcement, List<AnnouncementAttachment> announcementAttachmentList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateAnnouncement", table = "tbAnnouncement", tableParam = 5, params = {1}, sort = 1)
    @SqlId(clazz = SystemDao.class, sql = "deleteAnnouncementAttachment", table = "tbAnnouncementAttachment", tableParam = 5, params = {2}, sort = 2)
    @SqlId(clazz = SystemDao.class, sql = "insertAnnouncementAttachment", table = "tbAnnouncementAttachment", tableParam = 5, params = {3}, sort = 3)
    int updateAnnouncement(Announcement announcement, List<AnnouncementAttachment> deleteAttachmentList,
                           List<AnnouncementAttachment> insertAttachmentList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "voidAnnouncement", table = "tbAnnouncement", tableParam = 3, params = {1}, sort = 1)
    int voidAnnouncement(Announcement announcement, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "insertAnnouncementAttachmentList", table = "tbAnnouncementAttachment", tableParam = 3, params = {1}, sort = 1)
    int insertAnnouncementAttachment(List<AnnouncementAttachment> announcementAttachmentList, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
    //endregion

    //region 网站内容

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
    @SqlId(clazz = SystemDao.class, sql = "selectSiteContent", table = "tbSiteContent", params = {1})
    List<SiteContent> selectSiteContent(RMap params, PageFlipper pageFlipper, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "addSiteContent", table = "tbSiteContent", params = {1}, sort = 1)
    int addSiteContent(SiteContent siteContent, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "updateSiteContent", table = "tbSiteContent", params = {1}, sort = 1)
    int updateSiteContent(SiteContent siteContent, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
    @SqlId(clazz = SystemDao.class, sql = "deleteSiteContent", table = "tbSiteContent", params = {1}, sort = 1)
    int deleteSiteContent(SiteContent siteContent, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long idSupplier);

    //endregion
}
