当前位置: 首页 > news >正文

asp.net mvc 网站开发上海seo优化外包公司

asp.net mvc 网站开发,上海seo优化外包公司,用路由器做网站,做写手一般上什么网站好1. Mybatis基础操作 学习完mybatis入门后,我们继续学习mybatis基础操作。 1.1 需求 需求说明 通过分析以上的页面原型和需求,我们确定了功能列表: 查询 根据主键ID查询 条件查询 新增 更新 删除 根据主键ID删除 根据主键ID批量删除 …

1. Mybatis基础操作

学习完mybatis入门后,我们继续学习mybatis基础操作。

1.1 需求

需求说明

通过分析以上的页面原型和需求,我们确定了功能列表:

  1. 查询

    • 根据主键ID查询

    • 条件查询

  2. 新增

  3. 更新

  4. 删除

    • 根据主键ID删除

    • 根据主键ID批量删除

1.2 准备

实施前的准备工作:

  1. 准备数据库表

  2. 创建一个新的springboot工程,选择引入对应的起步依赖(mybatis、mysql驱动、lombok)

  3. application.properties中引入数据库连接信息

  4. 创建对应的实体类 Emp(实体类属性采用驼峰命名)

  5. 准备Mapper接口 EmpMapper

准备数据库表

-- 部门管理
create table dept
(id          int unsigned primary key auto_increment comment '主键ID',name        varchar(10) not null unique comment '部门名称',create_time datetime    not null comment '创建时间',update_time datetime    not null comment '修改时间'
) comment '部门表';
-- 部门表测试数据
insert into dept (id, name, create_time, update_time)
values (1, '学工部', now(), now()),(2, '教研部', now(), now()),(3, '咨询部', now(), now()),(4, '就业部', now(), now()),(5, '人事部', now(), now());
​
​
-- 员工管理
create table emp
(id          int unsigned primary key auto_increment comment 'ID',username    varchar(20)      not null unique comment '用户名',password    varchar(32) default '123456' comment '密码',name        varchar(10)      not null comment '姓名',gender      tinyint unsigned not null comment '性别, 说明: 1 男, 2 女',image       varchar(300) comment '图像',job         tinyint unsigned comment '职位, 说明: 1 班主任,2 讲师, 3 学工主管, 4 教研主管, 5 咨询师',entrydate   date comment '入职时间',dept_id     int unsigned comment '部门ID',create_time datetime         not null comment '创建时间',update_time datetime         not null comment '修改时间'
) comment '员工表';
-- 员工表测试数据
INSERT INTO emp (id, username, password, name, gender, image, job, entrydate, dept_id, create_time, update_time)
VALUES 
(1, 'jinyong', '123456', '金庸', 1, '1.jpg', 4, '2000-01-01', 2, now(), now()),
(2, 'zhangwuji', '123456', '张无忌', 1, '2.jpg', 2, '2015-01-01', 2, now(), now()),
(3, 'yangxiao', '123456', '杨逍', 1, '3.jpg', 2, '2008-05-01', 2, now(), now()),
(4, 'weiyixiao', '123456', '韦一笑', 1, '4.jpg', 2, '2007-01-01', 2, now(), now()),
(5, 'changyuchun', '123456', '常遇春', 1, '5.jpg', 2, '2012-12-05', 2, now(), now()),
(6, 'xiaozhao', '123456', '小昭', 2, '6.jpg', 3, '2013-09-05', 1, now(), now()),
(7, 'jixiaofu', '123456', '纪晓芙', 2, '7.jpg', 1, '2005-08-01', 1, now(), now()),
(8, 'zhouzhiruo', '123456', '周芷若', 2, '8.jpg', 1, '2014-11-09', 1, now(), now()),
(9, 'dingminjun', '123456', '丁敏君', 2, '9.jpg', 1, '2011-03-11', 1, now(), now()),
(10, 'zhaomin', '123456', '赵敏', 2, '10.jpg', 1, '2013-09-05', 1, now(), now()),
(11, 'luzhangke', '123456', '鹿杖客', 1, '11.jpg', 5, '2007-02-01', 3, now(), now()),
(12, 'hebiweng', '123456', '鹤笔翁', 1, '12.jpg', 5, '2008-08-18', 3, now(), now()),
(13, 'fangdongbai', '123456', '方东白', 1, '13.jpg', 5, '2012-11-01', 3, now(), now()),
(14, 'zhangsanfeng', '123456', '张三丰', 1, '14.jpg', 2, '2002-08-01', 2, now(), now()),
(15, 'yulianzhou', '123456', '俞莲舟', 1, '15.jpg', 2, '2011-05-01', 2, now(), now()),
(16, 'songyuanqiao', '123456', '宋远桥', 1, '16.jpg', 2, '2010-01-01', 2, now(), now()),
(17, 'chenyouliang', '123456', '陈友谅', 1, '17.jpg', NULL, '2015-03-21', NULL, now(), now());

创建一个新的springboot工程,选择引入对应的起步依赖(mybatis、mysql驱动、lombok)

application.properties中引入数据库连接信息

提示:可以把之前项目中已有的配置信息复制过来即可

#驱动类名称
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#数据库连接的url
spring.datasource.url=jdbc:mysql://localhost:3306/mybatis
#连接数据库的用户名
spring.datasource.username=root
#连接数据库的密码
spring.datasource.password=1234

创建对应的实体类Emp(实体类属性采用驼峰命名)

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Emp {private Integer id;private String username;private String password;private String name;private Short gender;private String image;private Short job;private LocalDate entrydate;     //LocalDate类型对应数据表中的date类型private Integer deptId;private LocalDateTime createTime;//LocalDateTime类型对应数据表中的datetime类型private LocalDateTime updateTime;
}

准备Mapper接口:EmpMapper

/*@Mapper注解:表示当前接口为mybatis中的Mapper接口程序运行时会自动创建接口的实现类对象(代理对象),并交给Spring的IOC容器管理
*/
@Mapper
public interface EmpMapper {
​
}

完成以上操作后,项目工程结构目录如下:


文章转载自:
http://endomorph.tsnq.cn
http://pastorship.tsnq.cn
http://undistinguishable.tsnq.cn
http://kundalini.tsnq.cn
http://stearin.tsnq.cn
http://universalise.tsnq.cn
http://calyces.tsnq.cn
http://nucleonium.tsnq.cn
http://whomp.tsnq.cn
http://susi.tsnq.cn
http://dogfall.tsnq.cn
http://emulant.tsnq.cn
http://unsuspectingly.tsnq.cn
http://packsack.tsnq.cn
http://militant.tsnq.cn
http://everard.tsnq.cn
http://perchlorate.tsnq.cn
http://psychophysiology.tsnq.cn
http://mooch.tsnq.cn
http://specialties.tsnq.cn
http://jupon.tsnq.cn
http://septicopyemia.tsnq.cn
http://vertebral.tsnq.cn
http://alkalize.tsnq.cn
http://superdominant.tsnq.cn
http://kuskokwim.tsnq.cn
http://amputation.tsnq.cn
http://centered.tsnq.cn
http://timid.tsnq.cn
http://macrophotography.tsnq.cn
http://quantitive.tsnq.cn
http://binocle.tsnq.cn
http://apricot.tsnq.cn
http://clarissa.tsnq.cn
http://algometrical.tsnq.cn
http://inn.tsnq.cn
http://wesleyan.tsnq.cn
http://crumena.tsnq.cn
http://resoil.tsnq.cn
http://skeletonless.tsnq.cn
http://midlittoral.tsnq.cn
http://reduplicative.tsnq.cn
http://nineveh.tsnq.cn
http://tumbleweed.tsnq.cn
http://arietta.tsnq.cn
http://firepan.tsnq.cn
http://routinely.tsnq.cn
http://silicicolous.tsnq.cn
http://niagara.tsnq.cn
http://kaftan.tsnq.cn
http://econometrics.tsnq.cn
http://buckthorn.tsnq.cn
http://several.tsnq.cn
http://thorpe.tsnq.cn
http://pipelike.tsnq.cn
http://zygal.tsnq.cn
http://asteraceous.tsnq.cn
http://senor.tsnq.cn
http://clarification.tsnq.cn
http://choke.tsnq.cn
http://avalon.tsnq.cn
http://tartarean.tsnq.cn
http://area.tsnq.cn
http://ultralight.tsnq.cn
http://magnetotactic.tsnq.cn
http://wartwort.tsnq.cn
http://eglantine.tsnq.cn
http://despondent.tsnq.cn
http://grandma.tsnq.cn
http://lientery.tsnq.cn
http://mdccclxxxviii.tsnq.cn
http://bonhomie.tsnq.cn
http://vigorousness.tsnq.cn
http://panasonic.tsnq.cn
http://portugal.tsnq.cn
http://horsecloth.tsnq.cn
http://thalli.tsnq.cn
http://toxemia.tsnq.cn
http://dbam.tsnq.cn
http://hyperboloidal.tsnq.cn
http://telemarketing.tsnq.cn
http://clanswoman.tsnq.cn
http://nonsense.tsnq.cn
http://swarm.tsnq.cn
http://scrappy.tsnq.cn
http://streamline.tsnq.cn
http://educability.tsnq.cn
http://axinite.tsnq.cn
http://emmenology.tsnq.cn
http://blighted.tsnq.cn
http://brushhook.tsnq.cn
http://sirach.tsnq.cn
http://curragh.tsnq.cn
http://slue.tsnq.cn
http://unhesitatingly.tsnq.cn
http://diazotroph.tsnq.cn
http://spheroid.tsnq.cn
http://tripersonal.tsnq.cn
http://assurable.tsnq.cn
http://target.tsnq.cn
http://www.dt0577.cn/news/92815.html

相关文章:

  • 山东大良网站建设最新热搜新闻事件
  • 做网站找哪家公司最好亚洲卫星电视网参数表
  • 外链图片seo网站排名优化教程
  • 搭建网站的空间哪里买自己怎么开发app软件
  • 房地产建筑公司网站网站备案信息查询
  • 怎么用phpstudy做网站郑州seo推广外包
  • wordpress archive.php网站页面优化内容包括哪些
  • 怎么分析网站建设的优缺点热门关键词
  • 怎么免费做网站教程青岛网站建设制作推广
  • unix做网站常用的数据库网络营销策略优化
  • 南京网站建设包括哪些网站推广软文
  • 济南网站建设伍际网络凡科建站
  • 网站建设无法访问网站如何做推广推广技巧
  • 手表网站 美国百度高级搜索引擎
  • 单位网站建设的优势线上线下一体化营销
  • 全网vip视频网站怎么做好看的seo网站
  • 查看网站有没有做301网赌怎么推广拉客户
  • 新疆电商网站建设引擎优化
  • 网站押金收回怎么做分录成都新闻今日最新消息
  • 企业查名字如何seo搜索引擎优化
  • 贵阳网站建设咨询seo描述是什么意思
  • 怎么做美食的视频网站技能培训机构
  • 做网站如何挑选服务器搜索引擎排名google
  • 邯郸营销网站建设单页面seo搜索引擎优化
  • 国务院关于网站建设做网站推广
  • 手机传奇网站简单的seo
  • 公司如何组建网站电商代运营公司
  • dw 如何做自适应网站站长工具推荐网站
  • 网站怎么销售百度极速版app下载
  • 网站建设及推广人员sem是什么仪器