第九次作业
BookInfoMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.rabbiter.bms.mapper.BookInfoMapper"><resultMap id="BaseResultMap" type="com.rabbiter.bms.model.BookInfo"><id column="bookId" jdbcType="INTEGER" property="bookid" /><result column="bookName" jdbcType="VARCHAR" property="bookname" /><result column="bookAuthor" jdbcType="VARCHAR" property="bookauthor" /><result column="bookPrice" jdbcType="DECIMAL" property="bookprice" /><result column="bookTypeId" jdbcType="INTEGER" property="booktypeid" /><result column="bookTypeName" jdbcType="INTEGER" property="booktypename" /><result column="bookDesc" jdbcType="VARCHAR" property="bookdesc" /><result column="isBorrowed" jdbcType="TINYINT" property="isborrowed" /><result column="bookImg" jdbcType="TINYINT" property="bookimg" /></resultMap><sql id="Base_Column_List">bookId, bookName, bookAuthor, bookPrice, bookTypeId, bookDesc, isBorrowed, bookImg</sql><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from book_infowhere bookId = #{bookid,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from book_infowhere bookId = #{bookid,jdbcType=INTEGER}</delete><insert id="insert" parameterType="com.rabbiter.bms.model.BookInfo">insert into book_info (bookId, bookName, bookAuthor, bookPrice, bookTypeId, bookDesc, isBorrowed, bookImg)values (#{bookid,jdbcType=INTEGER}, #{bookname,jdbcType=VARCHAR}, #{bookauthor,jdbcType=VARCHAR}, #{bookprice,jdbcType=DECIMAL}, #{booktypeid,jdbcType=INTEGER}, #{bookdesc,jdbcType=VARCHAR}, #{isborrowed,jdbcType=TINYINT}, #{bookimg,jdbcType=TINYINT})</insert><insert id="insertSelective" parameterType="com.rabbiter.bms.model.BookInfo">insert into book_info<trim prefix="(" suffix=")" suffixOverrides=","><if test="bookid != null">bookId,</if><if test="bookname != null">bookName,</if><if test="bookauthor != null">bookAuthor,</if><if test="bookprice != null">bookPrice,</if><if test="booktypeid != null">bookTypeId,</if><if test="bookdesc != null">bookDesc,</if><if test="isborrowed != null">isBorrowed,</if><if test="bookimg != null">bookImg,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="bookid != null">#{bookid,jdbcType=INTEGER},</if><if test="bookname != null">#{bookname,jdbcType=VARCHAR},</if><if test="bookauthor != null">#{bookauthor,jdbcType=VARCHAR},</if><if test="bookprice != null">#{bookprice,jdbcType=DECIMAL},</if><if test="booktypeid != null">#{booktypeid,jdbcType=INTEGER},</if><if test="bookdesc != null">#{bookdesc,jdbcType=VARCHAR},</if><if test="isborrowed != null">#{isborrowed,jdbcType=TINYINT},</if><if test="bookimg != null">#{bookimg,jdbcType=TINYINT},</if></trim></insert><update id="updateByPrimaryKeySelective" parameterType="com.rabbiter.bms.model.BookInfo">update book_info<set><if test="bookname != null">bookName = #{bookname,jdbcType=VARCHAR},</if><if test="bookauthor != null">bookAuthor = #{bookauthor,jdbcType=VARCHAR},</if><if test="bookprice != null">bookPrice = #{bookprice,jdbcType=DECIMAL},</if><if test="booktypeid != null">bookTypeId = #{booktypeid,jdbcType=INTEGER},</if><if test="bookdesc != null">bookDesc = #{bookdesc,jdbcType=VARCHAR},</if><if test="isborrowed != null">isBorrowed = #{isborrowed,jdbcType=TINYINT},</if><if test="bookimg != null">bookImg = #{bookimg,jdbcType=TINYINT},</if></set>where bookId = #{bookid,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="com.rabbiter.bms.model.BookInfo">update book_infoset bookName = #{bookname,jdbcType=VARCHAR},bookAuthor = #{bookauthor,jdbcType=VARCHAR},bookPrice = #{bookprice,jdbcType=DECIMAL},bookTypeId = #{booktypeid,jdbcType=INTEGER},bookDesc = #{bookdesc,jdbcType=VARCHAR},isBorrowed = #{isborrowed,jdbcType=TINYINT},bookImg = #{bookimg,jdbcType=TINYINT}where bookId = #{bookid,jdbcType=INTEGER}</update><select id="selectAllByLimit" resultMap="BaseResultMap">select bookId, bookName, bookAuthor,bookPrice, bookTypeId, bookDesc,isBorrowed, bookImg,(select bookTypeName from book_type where book_type.bookTypeId = book_info.bookTypeId) as bookTypeNamefrom book_infolimit #{begin}, #{size}</select><select id="selectCount" resultType="int">select count(*) from book_info</select><select id="selectCountBySearch" resultType="int">select count(*) from book_info<where><if test="bookname != null and bookname != '' ">and bookName like concat('%',#{bookname},'%')</if><if test="bookauthor != null and bookauthor != '' ">and bookAuthor like concat('%',#{bookauthor},'%')</if><if test="booktypeid != null and booktypeid != '' ">and bookTypeId = #{booktypeid}</if></where></select><select id="selectBySearch" resultMap="BaseResultMap">select bookId, bookName, bookAuthor,bookPrice, bookTypeId, bookDesc,isBorrowed, bookImg,(select bookTypeName from book_type where book_type.bookTypeId = book_info.bookTypeId) as bookTypeNamefrom book_info<where><if test="bookname != null and bookname != '' ">and bookName like concat('%',#{bookname},'%')</if><if test="bookauthor != null and bookauthor != '' ">and bookAuthor like concat('%',#{bookauthor},'%')</if><if test="booktypeid != null and booktypeid != '' ">and bookTypeId = #{booktypeid}</if></where>limit #{begin}, #{size}</select><select id="selectAll" resultMap="BaseResultMap">select bookId, bookName, bookAuthor,bookPrice, bookTypeId, bookDesc,isBorrowed, bookImg,(select bookTypeName from book_type where book_type.bookTypeId = book_info.bookTypeId) as bookTypeNamefrom book_info</select><select id="selectCountByType" resultType="int">select count(*) from book_info<where><if test="booktypeid != null and booktypeid != '' ">and bookTypeId = #{booktypeid}</if></where></select><select id="selectByType" resultMap="BaseResultMap">select bookId, bookName, bookAuthor,bookPrice, bookTypeId, bookDesc,isBorrowed, bookImg,(select bookTypeName from book_type where book_type.bookTypeId = book_info.bookTypeId) as bookTypeNamefrom book_info<where><if test="booktypeid != null and booktypeid != '' ">and bookTypeId = #{booktypeid}</if></where>limit #{begin}, #{size}</select>
</mapper>
BookTypeMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.rabbiter.bms.mapper.BookTypeMapper"><resultMap id="BaseResultMap" type="com.rabbiter.bms.model.BookType"><id column="bookTypeId" jdbcType="INTEGER" property="booktypeid" /><result column="bookTypeName" jdbcType="VARCHAR" property="booktypename" /><result column="bookTypeDesc" jdbcType="VARCHAR" property="booktypedesc" /></resultMap><sql id="Base_Column_List">bookTypeId, bookTypeName, bookTypeDesc</sql><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from book_typewhere bookTypeId = #{booktypeid,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from book_typewhere bookTypeId = #{booktypeid,jdbcType=INTEGER}</delete><insert id="insert" parameterType="com.rabbiter.bms.model.BookType">insert into book_type (bookTypeId, bookTypeName, bookTypeDesc)values (#{booktypeid,jdbcType=INTEGER}, #{booktypename,jdbcType=VARCHAR}, #{booktypedesc,jdbcType=VARCHAR})</insert><insert id="insertSelective" parameterType="com.rabbiter.bms.model.BookType">insert into book_type<trim prefix="(" suffix=")" suffixOverrides=","><if test="booktypeid != null">bookTypeId,</if><if test="booktypename != null">bookTypeName,</if><if test="booktypedesc != null">bookTypeDesc,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="booktypeid != null">#{booktypeid,jdbcType=INTEGER},</if><if test="booktypename != null">#{booktypename,jdbcType=VARCHAR},</if><if test="booktypedesc != null">#{booktypedesc,jdbcType=VARCHAR},</if></trim></insert><update id="updateByPrimaryKeySelective" parameterType="com.rabbiter.bms.model.BookType">update book_type<set><if test="booktypename != null">bookTypeName = #{booktypename,jdbcType=VARCHAR},</if><if test="booktypedesc != null">bookTypeDesc = #{booktypedesc,jdbcType=VARCHAR},</if></set>where bookTypeId = #{booktypeid,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="com.rabbiter.bms.model.BookType">update book_typeset bookTypeName = #{booktypename,jdbcType=VARCHAR},bookTypeDesc = #{booktypedesc,jdbcType=VARCHAR}where bookTypeId = #{booktypeid,jdbcType=INTEGER}</update><select id="selectAllByLimit" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from book_typelimit #{begin}, #{size}</select><select id="selectCount" resultType="int">select count(*) from book_type</select><select id="selectAll" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from book_type</select><select id="selectCountBySearch" resultType="int">select count(*) from book_type<where><if test="booktypename != null and booktypename != '' ">and bookTypeName like concat('%',#{booktypename},'%')</if></where></select><select id="selectBySearch" resultMap="BaseResultMap">select bookTypeId, bookTypeName, bookTypeDescfrom book_type<where><if test="booktypename != null and booktypename != '' ">and bookTypeName like concat('%',#{booktypename},'%')</if></where>limit #{begin}, #{size}</select>
</mapper>
BorrowMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.rabbiter.bms.mapper.BorrowMapper"><resultMap id="BaseResultMap" type="com.rabbiter.bms.model.Borrow"><id column="borrowId" jdbcType="INTEGER" property="borrowid" /><result column="userId" jdbcType="INTEGER" property="userid" /><result column="userName" jdbcType="INTEGER" property="username" /><result column="bookId" jdbcType="INTEGER" property="bookid" /><result column="bookName" jdbcType="INTEGER" property="bookname" /><result column="borrowTime" jdbcType="TIMESTAMP" property="borrowtime" /><result column="returnTime" jdbcType="TIMESTAMP" property="returntime" /></resultMap><sql id="Base_Column_List">borrowId, userId, bookId, borrowTime, returnTime</sql><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from borrowwhere borrowId = #{borrowid,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from borrowwhere borrowId = #{borrowid,jdbcType=INTEGER}</delete><insert id="insert" parameterType="com.rabbiter.bms.model.Borrow">insert into borrow (borrowId, userId, bookId, borrowTime, returnTime)values (#{borrowid,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{bookid,jdbcType=INTEGER}, #{borrowtime,jdbcType=TIMESTAMP}, #{returntime,jdbcType=TIMESTAMP})</insert><insert id="insertSelective" parameterType="com.rabbiter.bms.model.Borrow">insert into borrow<trim prefix="(" suffix=")" suffixOverrides=","><if test="borrowid != null">borrowId,</if><if test="userid != null">userId,</if><if test="bookid != null">bookId,</if><if test="borrowtime != null">borrowTime,</if><if test="returntime != null">returnTime,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="borrowid != null">#{borrowid,jdbcType=INTEGER},</if><if test="userid != null">#{userid,jdbcType=INTEGER},</if><if test="bookid != null">#{bookid,jdbcType=INTEGER},</if><if test="borrowtime != null">#{borrowtime,jdbcType=TIMESTAMP},</if><if test="returntime != null">#{returntime,jdbcType=TIMESTAMP},</if></trim></insert><update id="updateByPrimaryKeySelective" parameterType="com.rabbiter.bms.model.Borrow">update borrow<set><if test="userid != null">userId = #{userid,jdbcType=INTEGER},</if><if test="bookid != null">bookId = #{bookid,jdbcType=INTEGER},</if><if test="borrowtime != null">borrowTime = #{borrowtime,jdbcType=TIMESTAMP},</if><if test="returntime != null">returnTime = #{returntime,jdbcType=TIMESTAMP},</if></set>where borrowId = #{borrowid,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="com.rabbiter.bms.model.Borrow">update borrowset userId = #{userid,jdbcType=INTEGER},bookId = #{bookid,jdbcType=INTEGER},borrowTime = #{borrowtime,jdbcType=TIMESTAMP},returnTime = #{returntime,jdbcType=TIMESTAMP}where borrowId = #{borrowid,jdbcType=INTEGER}</update><select id="selectAllByLimit" resultMap="BaseResultMap">select borrowId, userId, bookId, borrowTime, returnTime,(select userName from user where borrow.userId = user.userId) userName,(select bookName from book_info where borrow.bookId = book_info.bookId) bookNamefrom borrowlimit #{begin}, #{size}</select><select id="selectCount" resultType="int">select count(*) from borrow</select><select id="selectCountBySearch" resultType="int">select count(*)from borrow, user, book_infowhere borrow.userId = user.userId and borrow.bookId = book_info.bookId<if test="bookId != null and bookId != '' ">and borrow.bookId like concat('%',#{bookId},'%')</if><if test="username != null and username != '' ">and userName like concat('%',#{username},'%')</if><if test="bookname != null and bookname != '' ">and bookName like concat('%',#{bookname},'%')</if><if test="userid != null and userid != '' ">and borrow.userId = #{userid}</if></select><select id="selectBySearch" resultMap="BaseResultMap">select borrowId, borrow.userId, borrow.bookId, borrowTime, returnTime, userName, bookNamefrom borrow, user, book_infowhere borrow.userId = user.userId and borrow.bookId = book_info.bookId<if test="username != null and username != '' ">and userName like concat('%',#{username},'%')</if><if test="bookname != null and bookname != '' ">and bookName like concat('%',#{bookname},'%')</if><if test="userid != null and userid != '' ">and borrow.userId = #{userid}</if>limit #{begin}, #{size}</select><select id="selectCountByReader" resultType="int">select count(*) from borrowwhere userId = #{userid}</select><select id="selectAllByLimitByReader" resultMap="BaseResultMap">select borrowId, userId, bookId, borrowTime, returnTime,(select userName from user where borrow.userId = user.userId) userName,(select bookName from book_info where borrow.bookId = book_info.bookId) bookNamefrom borrowwhere userId = #{userid}limit #{begin}, #{size}</select>
</mapper>
UserMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.rabbiter.bms.mapper.UserMapper"><resultMap id="BaseResultMap" type="com.rabbiter.bms.model.User"><id column="userId" jdbcType="INTEGER" property="userid" /><result column="userName" jdbcType="VARCHAR" property="username" /><result column="userPassword" jdbcType="VARCHAR" property="userpassword" /><result column="isAdmin" jdbcType="TINYINT" property="isadmin" /></resultMap><sql id="Base_Column_List">userId, userName, userPassword, isAdmin</sql><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from userwhere userId = #{userid,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from userwhere userId = #{userid,jdbcType=INTEGER}</delete><insert id="insert" parameterType="com.rabbiter.bms.model.User">insert into user (userId, userName, userPassword, isAdmin)values (#{userid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{userpassword,jdbcType=VARCHAR}, #{isadmin,jdbcType=TINYINT})</insert><insert id="insertSelective" parameterType="com.rabbiter.bms.model.User">insert into user<trim prefix="(" suffix=")" suffixOverrides=","><if test="userid != null">userId,</if><if test="username != null">userName,</if><if test="userpassword != null">userPassword,</if><if test="isadmin != null">isAdmin,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="userid != null">#{userid,jdbcType=INTEGER},</if><if test="username != null">#{username,jdbcType=VARCHAR},</if><if test="userpassword != null">#{userpassword,jdbcType=VARCHAR},</if><if test="isadmin != null">#{isadmin,jdbcType=TINYINT},</if></trim></insert><update id="updateByPrimaryKeySelective" parameterType="com.rabbiter.bms.model.User">update user<set><if test="username != null">userName = #{username,jdbcType=VARCHAR},</if><if test="userpassword != null">userPassword = #{userpassword,jdbcType=VARCHAR},</if><if test="isadmin != null">isAdmin = #{isadmin,jdbcType=TINYINT},</if></set>where userId = #{userid,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="com.rabbiter.bms.model.User">update userset userName = #{username,jdbcType=VARCHAR},userPassword = #{userpassword,jdbcType=VARCHAR},isAdmin = #{isadmin,jdbcType=TINYINT}where userId = #{userid,jdbcType=INTEGER}</update><select id="selectByUsernameAndPasswordAndIsAdmin" resultMap="BaseResultMap">select<include refid="Base_Column_List" />from userwhere userName = #{username}and userPassword = #{password}and isAdmin = #{isAdmin}limit 1</select><select id="selectByUsername" resultMap="BaseResultMap">select<include refid="Base_Column_List" />from userwhere userName = #{username}limit 1</select><select id="selectAllByLimit" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from userlimit #{begin}, #{size}</select><select id="selectCount" resultType="int">select count(*) from user</select><select id="selectAll" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from user</select><select id="selectCountBySearch" resultType="int">select count(*) from user<where><if test="username != null and username != '' ">and userName like concat('%',#{username},'%')</if></where></select><select id="selectBySearch" resultMap="BaseResultMap">select userId, userName, userPassword, isAdminfrom user<where><if test="username != null and username != '' ">and userName like concat('%',#{username},'%')</if></where>limit #{begin}, #{size}</select>
</mapper>
创建Git仓库
相关文章:

第九次作业
BookInfoMapper.xml <?xml version"1.0" encoding"UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace"com.rabbite…...

A股探底回升,跑出惊天大阳,你们知道为什么吗?
今天的A股,探底回升,让人惊呆了,你们知道是为什么吗?盘面上出现3个重要信号,一起来看看: 1、今天A股市场炸锅了,AI人工智能、国产软件、存储芯片迎来了涨停潮,惊呆了,科技…...

jenkins nginx自动化部署 php项目
在当今快速发展的IT领域,自动化部署已成为提高工作效率和减少错误的关键。Jenkins作为持续集成/持续部署(CI/CD)的佼佼者,结合Docker容器技术和PHP编程语言,以及Ansible自动化工具,可以实现高效、可靠的自动…...

海外代理IP哪个可靠?如何测试代理的稳定性?
在数字化时代,互联网已成为我们日常生活的重要组成部分。然而,随着网络活动的增加,我们面临的安全威胁也随之增加。 黑客攻击、数据泄露、网络钓鱼等安全事件频发,严重威胁着我们的个人隐私和网络安全。代理服务器在当今的互联网世…...

MySQL之可扩展性(四)
可扩展性 向外扩展 分片?还是不分片? 这是一个问题,对吧?答案很简单:如非必要,尽量不分片。首先看是否能通过性能调优或者更好的应用或数据库设计来推迟分片。如果能足够长时间地推迟分片,也许可以直接购买更大地服…...

JupyterLab使用指南(三):JupyterLab的Cell详细介绍
JupyterLab Cell 使用教程 JupyterLab 的 cell 是一种强大的工具,提供了编写、执行、展示和记录的全方位支持,使得复杂的计算任务变得简单直观。通过熟练掌握 cell 的各种操作和快捷键,用户可以显著提高工作效率,专注于解决实际问…...

solidity智能合约如何实现跨合约调用函数
背景 比如现在有一个需求、我需要通过外部合约获取BRC20 token的总交易量。那么我需要在brc20的转账函数里面做一些调整,主要是两个函数内统计转移量。然后再提供外部获取函数。 /*** dev Sets amount as the allowance of spender over the callers tokens.** Ret…...
关于Vue2的生命周期会问到哪些面试题?
在Vue2的面试中,关于生命周期的问题通常会涉及以下几个方面: 一、Vue2的生命周期概述 Vue2的生命周期是什么? Vue2的生命周期是指从Vue实例的创建、初始化数据、编译模板、挂载Dom、渲染、更新、卸载等一系列过程。 二、生命周期钩子函数 …...

尚品汇-(七)
(1)在网关中实现跨域 全局配置类实现 包名:com.atguigu.gmall.gateway.config 创建CorsConfig类 Configuration public class CorsConfig {Beanpublic CorsWebFilter corsWebFilter(){// cors跨域配置对象CorsConfiguration configuration…...

【Python datetime模块精讲】:时间旅行者的日志,精准操控日期与时间
文章目录 前言一、datetime模块简介二、常用类和方法三、date类四、time类五、datetime类六、timedelta类七、常用的函数和属性八、代码及其演示 前言 Python的datetime模块提供了日期和时间的类,用于处理日期和时间的算术运算。这个模块包括date、time、datetime和…...
keepalived 服务高可用(简约版)
本文基于centos 7记述如何使用keepalived 背景 为生产环境准备一台备机是极其必要的,防止主机宕掉无服务可用的情况出现。但是同一局域网内每台主机都分配了一个唯一IP,这些IP既然相互不同,那么服务请求的时候岂不是要切换IP地址?…...

【前端】Vue项目和微信小程序生成二维码和条形码
前言:哈喽,大家好,我是前端菜鸟的自我修养!今天给大家分享Vue项目和微信小程序如何生成二维码和条形码,介绍了JsBarcode、wxbarcode等插件,并提供具体代码帮助大家深入理解,彻底掌握!…...

同时使用接口文档swagger和knife4j
项目场景: springboot项目中同时使用接口文档swagger和knife4j 问题描述 在实体类中设置了字段必填的属性,在访问接口文档时出现异常 实体类关键代码片段 /*** 部门表 sys_dept*/ public class SysDept extends BaseEntity {private static final lo…...
Compose - 权限申请
官方介绍 一、概念 二、使用 Accompanist Permissions 官方介绍 不同版本中,权限状态(如PermissionState)中获取属性的方法不同,例如在“0.23.1”中,通过 PermissionState.hasPermission 属性拿到是否通过的 Boole…...
第十九条:要么为继承而设计并提供文档说明,要么就禁止继承
在前面一条中,我们已经知道了David写了A类被Tom拿去继承了,导致了A类的封装性遭到了破坏,那么有没有可能做点事情避免此事发生呢?第十九条孕育而生!David在创建A类的时候写上文档说明,说Al类不允许任何类来…...

Node.js全栈指南:浏览器显示一个网页
上一章,我们了解到,如何通过第二章的极简 Web 的例子来演示如何查看官方文档。为什么要把查阅官方文档放在前面的章节说明呢?因为查看文档是一个很重要的能力,就跟查字典一样。 回想一下,我们读小学,初中的…...

Linux远程桌面(Ubuntu/Deepin)——安装和使用 VNC 及通过 noVNC 实现浏览器实现远程桌面访问教程
在 Linux 上安装和使用 VNC 及通过 noVNC 实现浏览器远程访问教程 Windows上通常会自带xrdp远程桌面,但是当我们使用 Deepin 或 Ubuntu 系统作为开发机器且需要图形化界面的时候,就需要安装和配置 VNC(Virtual Network Computing)…...

2024年最新通信安全员考试题库
61.架设架空光缆,可使用吊板作业的情况是()。 A.在2.2/7规格的电杆与墙壁之间的吊线上,吊线高度5m B.在2.2/7规格的墙壁与墙壁之间的吊线上,吊线高度6m C.在2.2/7规格的电杆与电杆之间的吊线上,吊线高度…...

SpringMVC系列八: 手动实现SpringMVC底层机制-下
手动实现SpringMVC底层机制-下 实现任务阶段五🍍完成Spring容器对象的自动装配-Autowired 实现任务阶段六🍍完成控制器方法获取参数-RequestParam1.🥦将 方法的 HttpServletRequest 和 HttpServletResponse 参数封装到数组, 进行反射调用2.&a…...
【昇思初学入门】第八天打卡-模型保存与加载
模型保存与加载 学习心得 保存 CheckPoint 格式文件,在模型训练过程中,可以添加检查点(CheckPoint)用于保存模型的参数,以便进行推理及再训练使用。如果想继续在不同硬件平台上做推理,可通过网络和CheckPoint格式文件生成对应的…...
基于算法竞赛的c++编程(28)结构体的进阶应用
结构体的嵌套与复杂数据组织 在C中,结构体可以嵌套使用,形成更复杂的数据结构。例如,可以通过嵌套结构体描述多层级数据关系: struct Address {string city;string street;int zipCode; };struct Employee {string name;int id;…...
【杂谈】-递归进化:人工智能的自我改进与监管挑战
递归进化:人工智能的自我改进与监管挑战 文章目录 递归进化:人工智能的自我改进与监管挑战1、自我改进型人工智能的崛起2、人工智能如何挑战人类监管?3、确保人工智能受控的策略4、人类在人工智能发展中的角色5、平衡自主性与控制力6、总结与…...
椭圆曲线密码学(ECC)
一、ECC算法概述 椭圆曲线密码学(Elliptic Curve Cryptography)是基于椭圆曲线数学理论的公钥密码系统,由Neal Koblitz和Victor Miller在1985年独立提出。相比RSA,ECC在相同安全强度下密钥更短(256位ECC ≈ 3072位RSA…...

Qt/C++开发监控GB28181系统/取流协议/同时支持udp/tcp被动/tcp主动
一、前言说明 在2011版本的gb28181协议中,拉取视频流只要求udp方式,从2016开始要求新增支持tcp被动和tcp主动两种方式,udp理论上会丢包的,所以实际使用过程可能会出现画面花屏的情况,而tcp肯定不丢包,起码…...
IGP(Interior Gateway Protocol,内部网关协议)
IGP(Interior Gateway Protocol,内部网关协议) 是一种用于在一个自治系统(AS)内部传递路由信息的路由协议,主要用于在一个组织或机构的内部网络中决定数据包的最佳路径。与用于自治系统之间通信的 EGP&…...

HTML 列表、表格、表单
1 列表标签 作用:布局内容排列整齐的区域 列表分类:无序列表、有序列表、定义列表。 例如: 1.1 无序列表 标签:ul 嵌套 li,ul是无序列表,li是列表条目。 注意事项: ul 标签里面只能包裹 li…...

华为OD机试-食堂供餐-二分法
import java.util.Arrays; import java.util.Scanner;public class DemoTest3 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseint a in.nextIn…...

初学 pytest 记录
安装 pip install pytest用例可以是函数也可以是类中的方法 def test_func():print()class TestAdd: # def __init__(self): 在 pytest 中不可以使用__init__方法 # self.cc 12345 pytest.mark.api def test_str(self):res add(1, 2)assert res 12def test_int(self):r…...
rnn判断string中第一次出现a的下标
# coding:utf8 import torch import torch.nn as nn import numpy as np import random import json""" 基于pytorch的网络编写 实现一个RNN网络完成多分类任务 判断字符 a 第一次出现在字符串中的位置 """class TorchModel(nn.Module):def __in…...
Python ROS2【机器人中间件框架】 简介
销量过万TEEIS德国护膝夏天用薄款 优惠券冠生园 百花蜂蜜428g 挤压瓶纯蜂蜜巨奇严选 鞋子除臭剂360ml 多芬身体磨砂膏280g健70%-75%酒精消毒棉片湿巾1418cm 80片/袋3袋大包清洁食品用消毒 优惠券AIMORNY52朵红玫瑰永生香皂花同城配送非鲜花七夕情人节生日礼物送女友 热卖妙洁棉…...