苦尽甘来 一个月学通JavaWeb(四十七 WMS系统)

版权声明:Genius https://blog.csdn.net/weixin_41987706/article/details/88818300

夜光序言:

所谓孤独就是,道前无人等你,身后无人陪你。

 

正文:

package com.ken.wms.dao;

import com.ken.wms.domain.AccessRecordDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 用户登入登出记录因映射器
 *
 * @author Ken /  Yeguang / Genius Team
 * @since 
 */
@Repository
public interface AccessRecordMapper {

    /**
     * 插入一条用户用户登入登出记录
     *
     * @param accessRecordDO 用户登入登出记录
     */
    void insertAccessRecord(AccessRecordDO accessRecordDO);

    /**
     * 选择指定用户ID、记录类型、时间范围的登入登出记录
     *
     * @param userID     用户ID
     * @param accessType 记录类型(登入、登出或所有)
     * @param startDate  记录的起始日期
     * @param endDate    记录的结束日期
     * @return 返回所有符合条件的记录
     */
    List<AccessRecordDO> selectAccessRecords(@Param("userID") Integer userID,
                                             @Param("accessType") String accessType,
                                             @Param("startDate") Date startDate,
                                             @Param("endDate") Date endDate);
}
package com.ken.wms.dao;

import com.ken.wms.domain.Customer;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 客户信息 Customer 映射器
 * @author Ken /  Yeguang / Genius Team
 *
 */
@Repository
public interface CustomerMapper {

	/**
	 * 选择所有的 Customer
	 * @return 返回所有的 Customer
	 */
	List<Customer> selectAll();
	
	/**
	 * 选择指定 id 的 Supplier
	 * @param id Customer的ID
	 * @return 返回指定ID对应的Customer
	 */
	Customer selectById(Integer id);
	
	/**
	 * 选择指定 Customer name 的 customer
	 * @param customerName 客户的名称
	 * @return 返回指定CustomerName对应的Customer
	 */
	Customer selectByName(String customerName);
	
	/**
	 * 选择指定 customer name 的 Customer
	 * 与 selectByName 方法的区别在于本方法将返回相似匹配的结果
	 * @param customerName Customer 供应商名
	 * @return 返回模糊匹配指定customerName 对应的Customer
	 */
	List<Customer> selectApproximateByName(String customerName);
	
	/**
	 * 插入 Customer 到数据库中
	 * 不需要指定 Customer 的主键,采用的数据库 AI 方式
	 * @param customer Customer 实例
	 */
	void insert(Customer customer);
	
	/**
	 * 批量插入 Customer 到数据库中
	 * @param customers 存放 Customer 实例的 List
	 */
	void insertBatch(List<Customer> customers);
	
	/**
	 * 更新 Customer 到数据库
	 * 该 Customer 必须已经存在于数据库中,即已经分配主键,否则将更新失败
	 * @param customer customer 实例
	 */
	void update(Customer customer);
	
	/**
	 * 删除指定 id 的 customer
	 * @param id customer ID
	 */
	void deleteById(Integer id);
	
	/**
	 * 删除指定 customerName 的 customer
	 * @param customerName 客户名称
	 */
	void deleteByName(String customerName);
}
package com.ken.wms.dao;


import com.ken.wms.domain.Goods;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 货物信息映射器
 * @author Ken  /  Yeguang / Genius Team
 *
 */
@Repository
public interface GoodsMapper {

	/**
	 * 选择所有的 Goods
	 * @return 返回所有的Goods
	 */
	List<Goods> selectAll();
	
	/**
	 * 选择指定 id 的 Goods
	 * @param id 货物的ID
	 * @return 返回执行ID对应的Goods
	 */
	Goods selectById(Integer id);
	
	/**
	 * 选择指定 Goods name 的 Goods
	 * @param goodsName 货物的名称
	 * @return 返回指定GoodsName对应的货物
	 */
	Goods selectByName(String goodsName);
	
	/**
	 * 选择制定 goods name 的 goods
	 * 模糊匹配
	 * @param goodsName 货物德名称
	 * @return 返回模糊匹配指定goodsName的货物
	 */
	List<Goods> selectApproximateByName(String goodsName);
	
	/**
	 * 插入一条新的记录到数据库
	 * @param goods 货物信息
	 */
	void insert(Goods goods);
	
	/**
	 * 批量插入新的记录到数据库中
	 * @param goods 存放 goods 信息的 List
	 */
	void insertBatch(List<Goods> goods);
	
	/**
	 * 更新 Goods 到数据库中
	 * 该 Customer 必须已经存在于数据库中,即已经分配主键,否则将更新失败
	 * @param goods 货物信息
	 */
	void update(Goods goods);
	
	/**
	 * 删除指定 id 的 goods
	 * @param id 货物ID
	 */
	void deleteById(Integer id);
	
	/**
	 * 删除指定 goods name 的 goods
	 * @param goodsName 货物的名称
	 */
	void deleteByName(String goodsName);
}
package com.ken.wms.dao;

import com.ken.wms.domain.RepositoryAdmin;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * RepositoryAdmin 映射器
 * @author Ken
 *
 */
@Repository
public interface RepositoryAdminMapper {

	/**
	 * 选择指定 ID 的仓库管理员信息
	 * @param id 仓库管理员ID
	 * @return 返回指定 ID 的仓库管理员信息
	 */
	RepositoryAdmin selectByID(Integer id);
	
	/**
	 * 选择指定 name 的仓库管理员信息。
	 * 支持模糊查找
	 * @param name 仓库管理员名字
	 * @return 返回若干条指定 name 的仓库管理员信息
	 */
	List<RepositoryAdmin> selectByName(String name);
	
	/**
	 * 选择所有的仓库管理员信息
	 * @return 返回所有的仓库管理员信息
	 */
	List<RepositoryAdmin> selectAll();
	
	/**
	 * 选择已指派指定 repositoryID 的仓库管理员信息
	 * @param repositoryID 指派的仓库ID
	 * @return 返回已指派指定 repositoryID 的仓库管理员信息
	 */
	RepositoryAdmin selectByRepositoryID(Integer repositoryID);
	
	/**
	 * 插入一条仓库管理员信息
	 * @param repositoryAdmin 仓库管理员信息
	 */
	void insert(RepositoryAdmin repositoryAdmin);
	
	/**
	 * 批量插入仓库管理员信息
	 * @param repositoryAdmins 存放若干条仓库管理员信息的 List
	 */
	void insertBatch(List<RepositoryAdmin> repositoryAdmins);
	
	/**
	 * 更新仓库管理员信息
	 * @param repositoryAdmin 仓库管理员信息
	 */
	void update(RepositoryAdmin repositoryAdmin);
	
	/**
	 * 删除指定 ID 的仓库管理员信息
	 * @param id 仓库管理员 ID
	 */
	void deleteByID(Integer id);
}








package com.ken.wms.dao;

import com.ken.wms.domain.Repository;

import java.util.List;

/**
 * Repository 映射器
 * @author Ken
 *
 */
@org.springframework.stereotype.Repository
public interface RepositoryMapper {

	/**
	 * 选择全部的 Repository 记录
	 * @return 返回全部的 Repository
	 */
	List<Repository> selectAll();
	
	/**
	 * 选择全部的未分配的 repository 记录
	 * @return 返回所有未分配的 Repository
	 */
	List<Repository> selectUnassign();
	
	/**
	 * 选择指定 Repository ID 的 Repository 记录
	 * @param repositoryID 仓库ID
	 * @return 返回指定的Repository
	 */
	Repository selectByID(Integer repositoryID);
	
	/**
	 * 选择指定 repository Address 的 repository 记录
	 * @param address 仓库地址
	 * @return 返回指定的Repository 
	 */
	List<Repository> selectByAddress(String address);
	
	/**
	 * 插入一条新的 Repository 记录
	 * @param repository 仓库信息
	 */
	void insert(Repository repository);
	
	/**
	 * 批量插入 Repository 记录
	 * @param repositories 存有若干条记录的 List
	 */
	void insertbatch(List<Repository> repositories);
	
	/**
	 * 更新 Repository 记录
	 * @param repository 仓库信息
	 */
	void update(Repository repository);
	
	/**
	 * 删除指定 Repository ID 的 Repository 记录
	 * @param repositoryID 仓库ID
	 */
	void deleteByID(Integer repositoryID);
}







package com.ken.wms.dao;

import com.ken.wms.domain.RolePermissionDO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 角色权限信息 Mapper
 *
 * @author ken
 * @since  
 */
@Repository
public interface RolePermissionMapper {

    List<RolePermissionDO> selectAll();
}




package com.ken.wms.dao;

import org.springframework.stereotype.Repository;

/**
 *
 * @author 
 * @since 
 */
@Repository
public interface RolesMapper {

    /**
     * 获取角色对应的ID
     * @param roleName 角色名
     * @return 返回角色的ID
     */
    Integer getRoleID(String roleName);

}


package com.ken.wms.dao;

import com.ken.wms.domain.StockInDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 入库记录映射器
 *
 * @author Ken
 */
@Repository
public interface StockInMapper {

    /**
     * 选择全部的入库记录
     *
     * @return 返回全部的入库记录
     */
    List<StockInDO> selectAll();

    /**
     * 选择指定供应商ID相关的入库记录
     *
     * @param supplierID 指定的供应商ID
     * @return 返回指定供应商相关的入库记录
     */
    List<StockInDO> selectBySupplierId(Integer supplierID);

    /**
     * 选择指定货物ID相关的入库记录
     *
     * @param goodID 指定的货物ID
     * @return 返回指定货物相关的入库记录
     */
    List<StockInDO> selectByGoodID(Integer goodID);

    /**
     * 选择指定仓库ID相关的入库记录
     *
     * @param repositoryID 指定的仓库ID
     * @return 返回指定仓库相关的入库记录
     */
    List<StockInDO> selectByRepositoryID(Integer repositoryID);

    /**
     * 选择指定仓库ID以及指定日期范围内的入库记录
     *
     * @param repositoryID 指定的仓库ID
     * @param startDate    记录的起始日期
     * @param endDate      记录的结束日期
     * @return 返回所有符合要求的入库记录
     */
    List<StockInDO> selectByRepositoryIDAndDate(@Param("repositoryID") Integer repositoryID,
                                                @Param("startDate") Date startDate,
                                                @Param("endDate") Date endDate);

    /**
     * 选择指定入库记录的ID的入库记录
     *
     * @param id 入库记录ID
     * @return 返回指定ID的入库记录
     */
    StockInDO selectByID(Integer id);

    /**
     * 添加一条新的入库记录
     *
     * @param stockInDO 入库记录
     */
    void insert(StockInDO stockInDO);

    /**
     * 更新入库记录
     *
     * @param stockInDO 入库记录
     */
    void update(StockInDO stockInDO);

    /**
     * 删除指定ID的入库记录
     *
     * @param id 指定删除入库记录的ID
     */
    void deleteByID(Integer id);
}






package com.ken.wms.dao;

import com.ken.wms.domain.StockOutDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 出库记录 映射器
 *
 * @author Ken
 */
@Repository
public interface StockOutMapper {

    /**
     * 选择全部的出库记录
     *
     * @return 返回所有的出库记录
     */
    List<StockOutDO> selectAll();

    /**
     * 选择指定客户ID相关的出库记录
     *
     * @param customerId 指定的客户ID
     * @return 返回指定客户相关的出库记录
     */
    List<StockOutDO> selectByCustomerId(Integer customerId);

    /**
     * 选择指定货物ID相关的出库记录
     *
     * @param goodId 指定的货物ID
     * @return 返回指定货物ID相关的出库记录
     */
    List<StockOutDO> selectByGoodId(Integer goodId);

    /**
     * 选择指定仓库ID关联的出库记录
     *
     * @param repositoryID 指定的仓库ID
     * @return 返回指定仓库ID相关的出库记录
     */
    List<StockOutDO> selectByRepositoryID(Integer repositoryID);

    /**
     * 选择指定仓库ID以及指定日期范围内的出库记录
     *
     * @param repositoryID 指定的仓库ID
     * @param startDate    记录起始日期
     * @param endDate      记录结束日期
     * @return 返回所有符合指定要求的出库记录
     */
    List<StockOutDO> selectByRepositoryIDAndDate(@Param("repositoryID") Integer repositoryID,
                                                 @Param("startDate") Date startDate,
                                                 @Param("endDate") Date endDate);

    /**
     * 选择指定ID的出库记录
     *
     * @param id 指定的出库记录ID
     * @return 返回指定ID的出库记录
     */
    StockOutDO selectById(Integer id);

    /**
     * 插入一条新的出库记录
     *
     * @param stockOutDO 出库记录
     */
    void insert(StockOutDO stockOutDO);

    /**
     * 更新出库记录
     *
     * @param stockOutDO 出库记录
     */
    void update(StockOutDO stockOutDO);

    /**
     * 删除指定ID的出库记录
     *
     * @param id 指定的出库记录ID
     */
    void deleteById(Integer id);
}






package com.ken.wms.dao;

import com.ken.wms.domain.Storage;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


import java.util.List;

/**
 * 库存信息映射器
 * @author Ken
 *
 */
@Repository
public interface StorageMapper {

	/**
	 * 选择所有的库存信息
	 * @return 返回所有的库存信息
	 */
	List<Storage> selectAllAndRepositoryID(@Param("repositoryID") Integer repositoryID);
	
	/**
	 * 选择指定货物ID和仓库ID的库存信息
	 * @param goodsID 货物ID
	 * @param repositoryID 库存ID
	 * @return 返回所有指定货物ID和仓库ID的库存信息
	 */
	List<Storage> selectByGoodsIDAndRepositoryID(@Param("goodsID") Integer goodsID,
												 @Param("repositoryID") Integer repositoryID);
	
	/**
	 * 选择指定货物名的库存信息
	 * @param goodsName 货物名称
	 * @return 返回所有指定货物名称的库存信息
	 */
	List<Storage> selectByGoodsNameAndRepositoryID(@Param("goodsName") String goodsName,
												   @Param("repositoryID") Integer repositoryID);
	
	/**
	 * 选择指定货物类型的库存信息
	 * @param goodsType 货物类型
	 * @return 返回所有指定货物类型的库存信息
	 */
	List<Storage> selectByGoodsTypeAndRepositoryID(@Param("goodsType") String goodsType,
												   @Param("repositoryID") Integer repositoryID);
	
	/**
	 * 更新库存信息
	 * 该库存信息必需已经存在于数据库当中,否则更新无效
	 * @param storage 库存信息
	 */
	void update(Storage storage);
	
	/**
	 * 插入新的库存信息
	 * @param storage 库存信息
	 */
	void insert(Storage storage);
	
	/**
	 * 批量导入库存信息
	 * @param storages 若干条库存信息
	 */
	void insertBatch(List<Storage> storages);
	
	/**
	 * 删除指定货物ID的库存信息
	 * @param goodsID 货物ID
	 */
	void deleteByGoodsID(Integer goodsID);
	
	/**
	 * 删除指定仓库的库存信息
	 * @param repositoryID 仓库ID
	 */
	void deleteByRepositoryID(Integer repositoryID);
	
	/**
	 * 删除指定仓库中的指定货物的库存信息
	 * @param goodsID 货物ID
	 * @param repositoryID 仓库ID
	 */
	void deleteByRepositoryIDAndGoodsID(@Param("goodsID") Integer goodsID, @Param("repositoryID") Integer repositoryID);
}






package com.ken.wms.dao;

import com.ken.wms.domain.Supplier;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Supplier 映射器
 * @author Ken
 *
 */
@Repository
public interface SupplierMapper {

	/**
	 * 选择全部的 Supplier
	 * @return 返回所有的供应商
	 */
	List<Supplier> selectAll();
	
	/**
	 * 选择指定 id 的 Supplier
	 * @param id 供应商ID
	 * @return 返回指定ID对应的供应商
	 */
	Supplier selectById(Integer id);
	
	/**
	 * 选择指定 supplier name 的 Supplier
	 * @param supplierName 供应商名称
	 * @return 返回supplierName对应的供应商
	 */
	Supplier selectBuName(String supplierName);
	
	/**
	 * 选择指定 supplier name 的 Supplier
	 * 与 selectBuName 方法的区别在于本方法将返回相似匹配的结果
	 * @param supplierName 供应商名
	 * @return 返回所有模糊匹配指定supplierName的供应商
	 */
	List<Supplier> selectApproximateByName(String supplierName);
	
	/**
	 * 插入 Supplier 到数据库中
	 * 不需要指定 Supplier 的主键,采用的数据库 AI 方式
	 * @param supplier Supplier 实例
	 */
	void insert(Supplier supplier);
	
	/**
	 * 批量插入 Supplier 到数据库中
	 * @param suppliers 存放 Supplier 实例的 Lists
	 */
	void insertBatch(List<Supplier> suppliers);
	
	/**
	 * 更新 Supplier 到数据库
	 * 该 Supplier 必须已经存在于数据库中,即已经分配主键,否则将更新失败
	 * @param supplier Supplier 实例
	 */
	void update(Supplier supplier);
	
	/**
	 * 删除指定 id 的Supplier
	 * @param id 供应商ID
	 */
	void deleteById(Integer id);
	
	/**
	 * 删除指定 supplierName 的 Supplier
	 * @param supplierName 供应商名称
	 */
	void deleteByName(String supplierName);
	
}







package com.ken.wms.dao;

import com.ken.wms.domain.UserInfoDO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户账户信息 Mapper
 *
 * @author ken
 * @since 
 */
@Repository
public interface UserInfoMapper {

    /**
     * 选择指定 id 的 user 信息
     *
     * @param userID 用户ID
     * @return 返回指定 userID 对应的 user 信息
     */
    UserInfoDO selectByUserID(Integer userID);

    /**
     * 选择指定 userName 的 user 信息
     *
     * @param userName 用户名
     * @return 返回指定 userName 对应的 user 信息
     */
    UserInfoDO selectByName(String userName);

    /**
     * 选择全部的 user 信息
     *
     * @return 返回所有的 user 信息
     */
    List<UserInfoDO> selectAll();


    /**
     * 更新 user 对象信息
     *
     * @param user 更新 user 对象信息
     */
    void update(UserInfoDO user);

    /**
     * 删除指定 id 的user 信息
     *
     * @param id 用户ID
     */
    void deleteById(Integer id);

    /**
     * 插入一个 user 对象信息
     * 不需指定对象的主键id,数据库自动生成
     *
     * @param user 需要插入的用户信息
     */
    void insert(UserInfoDO user);

}





package com.ken.wms.dao;

import com.ken.wms.domain.UserOperationRecordDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 用户操作记录Mapper
 *
 * @author Ken
 * @since 
 */
@Repository
public interface UserOperationRecordMapper {

    /**
     * 选择指定用户ID,或时间范围的用户操作记录
     *
     * @param userID    指定的用户ID
     * @param startDate 记录的起始日期
     * @param endDate   记录的结束日期
     * @return 返回所有符合条件的记录
     */
    List<UserOperationRecordDO> selectUserOperationRecord(@Param("userID") Integer userID,
                                                          @Param("startDate") Date startDate,
                                                          @Param("endDate") Date endDate);

    /**
     * 插入用户操作记录
     *
     * @param userOperationRecordDO 用户操作记录
     */
    void insertUserOperationRecord(UserOperationRecordDO userOperationRecordDO);
}




package com.ken.wms.dao;

import com.ken.wms.domain.RoleDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户角色权限映射器
 * @author Ken
 *
 */
@Repository
public interface UserPermissionMapper {

    /**
     * 为指定 userID 用户指派指定 roleID 的角色
     * @param userID 用户ID
     * @param roleID 角色ID
     */
	void insert(@Param("userID") Integer userID, @Param("roleID") Integer roleID);

    /**
     * 删除指定用户的角色
     * @param userID 用户ID
     */
	void deleteByUserID(Integer userID);

    /**
     * 获取指定 userID 对应用户拥有的角色
     * @param userID 用户ID
     * @return 返回 userID 指定用户的角色
     */
    List<RoleDO> selectUserRole(Integer userID);
}

猜你喜欢

转载自blog.csdn.net/weixin_41987706/article/details/88818300