码迷,mamicode.com
首页 > 其他好文 > 详细

给丫头学习打卡开发的系统

时间:2019-05-20 19:12:02      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:学习打卡   def   jdbc   update   char   desc   tail   dmi   status   

DROP TABLE IF EXISTS `buser`;
CREATE TABLE `buser`  (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `userid` varchar(40) NULL DEFAULT NULL,
  `password` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `mobile` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `role` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `creationdt` datetime(0) NOT NULL,
  `updatedt` datetime(0) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;


DROP TABLE IF EXISTS `btype`;
CREATE TABLE `btype`  (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) NULL DEFAULT NULL,
  `cid` int(4) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;


DROP TABLE IF EXISTS `bcontent`;
CREATE TABLE `bcontent`  (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `tid` int(4) NOT NULL,
	`uid` int(4) NOT NULL,
  `time` datetime(0) NOT NULL,
  `description` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `details` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `creationdt` datetime(0) NOT NULL,
  `updatedt` datetime(0) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;



select * from buser;
select id,name from btype where cid =1;


select id,tid,uid,time ,description,details,creationdt,updatedt from bcontent;

insert bcontent(tid,uid,time ,description,details,creationdt,updatedt)
values(1,1,now(),‘大学‘,‘大学之道在明明德‘,now(),now())




update bcontent set tid = #{tid},description = #{desc},details = #{details},updatedt = #{tasknum,jdbcType=LONGVARCHAR}
where id = #{id}


        INSERT INTO BBUG
(BUG_PROJECT_ID,BUG_CR_TYPE_ID,BUG_CR_NUM,BUG_TASK_NUM,BUG_TYPE_ID,
BUG_DESCRIPTION,BUG_RCA,BUG_SOLUTION,BUG_ASSIGNEE_ID,BUG_TESTER_ID,
BUG_CREATIONDT,BUG_UPDATEDT,BUG_STATUS_ID,BUG_CREATIONUID,BUG_UPDATEUID)
VALUES (4, 2, #{crnum,jdbcType=LONGVARCHAR}, #{tasknum,jdbcType=LONGVARCHAR}, 4,
 #{description,jdbcType=LONGVARCHAR},  #{rca,jdbcType=LONGVARCHAR},  #{solution,jdbcType=LONGVARCHAR}, 3, 8,
#{creationdt,jdbcType=LONGVARCHAR}, #{updatedt,jdbcType=LONGVARCHAR}, 1,#{creationuid,jdbcType=LONGVARCHAR},#{updateuid,jdbcType=LONGVARCHAR});
    

select * from bcontent;
select FROM_UNIXTIME(time,‘%Y年%m月%d‘) from bcontent

SELECT  FROM_UNIXTIME(‘time‘, ‘%Y-%m-%d %H:%i:%s‘)   FROM bcontent


select str_to_date(time, ‘%Y.%m.%d %h:%i:%s‘) FROM bcontent; --输出空
select str_to_date(time, ‘%m.%d.%Y %h:%i:%s‘) as time  FROM bcontent; --输出‘2008-08-09 08:09:30‘


SELECT FROM_UNIXTIME(1542470399,‘%Y年%m月%d日‘);   输出结果为2018-11-17



SELECT DATE_FORMAT(time,‘%Y年%m月%d日‘) as time from bcontent; 


insert btype(name,cid) values(‘儿歌‘,1);
insert btype(name,cid) values(‘古诗‘,1);
insert btype(name,cid) values(‘歌曲‘,1);
insert btype(name,cid) values(‘体育‘,1);
insert btype(name,cid) values(‘英语‘,1);
insert btype(name,cid) values(‘数学‘,1);
insert btype(name,cid) values(‘舞蹈‘,1);
insert btype(name,cid) values(‘画画‘,1);

desc buser;
desc bcontent;


select count(*) from buser where userid = 
select * from buser;


select id,userid,password, mobile,role from buser where userid  = ‘admin‘

update buser set role = ‘ROLE_ADMIN,ROLE_USER‘


insert buser(userid,password,mobile,role,creationdt,updatedt)
values(‘admin‘,‘$2a$10$iwc36dEXMLLiTzoq71XZbeCzhOd5OyKDDvEsT3i3Mi73EUhdt4VsK‘,‘‘,‘ROLE_ADMIN‘,now(),now())

  

给丫头学习打卡开发的系统

标签:学习打卡   def   jdbc   update   char   desc   tail   dmi   status   

原文地址:https://www.cnblogs.com/qianjinyan/p/10895719.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!