摘要: int a=9; int b=7;float c = (float) a / (float) b; //把整型数据 转换为 浮点型 数据System.out.println(c);System.out.println( String.format("%.2f", c));//保留小数点后2位 方法有 阅读全文
posted @ 2023-06-30 17:44 苹果芒 阅读(335) 评论(0) 推荐(0) 编辑
摘要: SELECT * FROM result co where <if test="projectId != null"> co.projectId=#{projectId} and </if> <if test="startTime!=null and endTime!=null"> modifyTi 阅读全文
posted @ 2023-06-30 17:35 苹果芒 阅读(52) 评论(0) 推荐(0) 编辑
摘要: insert into result(userId,year,month,increaseRate,decreaseRate,autoRate,finishRate,createTime,modifyTime) values( #{userId},#{year},#{month},#{increas 阅读全文
posted @ 2023-06-30 17:32 苹果芒 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 如果想进行对一个字段进行排序,但是这个字段却不是int类型,适应varchar类型怎么办呢? 常用的方式: 给字符字段加上0,举例: 1:假设scoreRate是一个varchar类型,并且值是一个百分(90%)的数据格式. 要求:请获取scoreRate值最高的一条数据: sql: select 阅读全文
posted @ 2023-06-30 17:30 苹果芒 阅读(146) 评论(0) 推荐(0) 编辑
摘要: SQL UNIQUE 约束也称“唯一约束”,设置了 UNIQUE 约束的字段,每条记录的值都必须是唯一的,因此 UNIQUE 约束可以防止两条记录在某个字段上出现重复值。 UNIQUE 可以约束表的一个字段,也可以约束多个字段。此外,设置了 UNIQUE 约束的字段可以出现 NULL 值。 UNIQ 阅读全文
posted @ 2023-06-30 17:22 苹果芒 阅读(724) 评论(0) 推荐(0) 编辑
摘要: 1.正常情况下,你可能会这样写: @PostMapping("/delete") @ApiOperation("Delete list data") @ResponseStatus(HttpStatus.OK) @ResponseBody public DBUpdateStatus deleteTe 阅读全文
posted @ 2023-06-21 11:04 苹果芒 阅读(237) 评论(0) 推荐(0) 编辑
摘要: python 子类调用父类方法 方法一 调用未绑定的父类的构造方法方法二 使用 super 函数假设存在 Person 与 Student 两个类: class Person(object): def __init__(self): self.name = "Tom" def getName(sel 阅读全文
posted @ 2023-06-19 14:40 苹果芒 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 例如在进行打开pycharm的软件的界面当中,需要替换内容 把300 进行替换。 首先需要把鼠标点击到这个右边的代码py模块中。这样才能聚焦到是这个文件(如果不这样才做,下方的操作中 你会发现Find选项是置灰的) 进行点击菜单 pycharm的中的 edit 的选项菜单。 进行点击edit的菜单之 阅读全文
posted @ 2023-06-16 18:38 苹果芒 阅读(480) 评论(0) 推荐(0) 编辑
摘要: path=os.path.realpath(__file__) cwd=os.path.split(path)[0] open(cwd+os.path.sep+"usage_result.xls","wb").write(response.content) 上面是写入文件的简单的一个方式。 一,读取 阅读全文
posted @ 2023-06-15 21:32 苹果芒 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 今天我们一起学习如何使用不同的Python模块从web下载文件。此外,你将下载常规文件、web页面、Amazon S3和其他资源。 最后,你将学习如何克服可能遇到的各种挑战,例如下载重定向的文件、下载大型文件、完成一个多线程下载以及其他策略。 1、使用requests 你可以使用requests模块 阅读全文
posted @ 2023-06-15 21:27 苹果芒 阅读(94) 评论(0) 推荐(0) 编辑