随笔分类 -  mysql

摘要:ALTER TABLE circle_like ADD UNIQUE KEY(read_circle_id, user_id); try{ circleLikeService.insertSelective(circleLike); Map<String, Object> map = new Has 阅读全文
posted @ 2018-06-07 14:49 qwer78 阅读(42) 评论(0) 推荐(0)
摘要:mapper.xml在使用 <if test="status != null">判断时候 如果传的Integer参数的值是0的话 会判为空!!! 所以写成 <if test="status != null and status != '' or status == 0">foreach foreac 阅读全文
posted @ 2018-02-05 14:32 qwer78 阅读(39) 评论(0) 推荐(0)
摘要:<select id="searchUser" parameterType="java.lang.String" resultType="com.datebook.vo.UserDetailVO"> select id,mobile,header,nickname,gender,birthday,s 阅读全文
posted @ 2018-01-12 10:26 qwer78 阅读(269) 评论(0) 推荐(0)
摘要:1 MySQL的版本 utf8mb4的最低mysql版本支持版本为5.5.3+,若不是,请升级到较新版本。 2 MySQL驱动 5.1.34可用,最低不能低于5.1.13(开始没修改mysql的配置文件 导致服务器的mysql驱动jar包只能用5.1.13版本,升级版本就会报错,坑死) 3 修改My 阅读全文
posted @ 2017-11-06 10:03 qwer78 阅读(50) 评论(0) 推荐(0)
摘要:eclipse版本 1.给你的ide下载这个插件,并确定成功可用。具体百度 (eclipse直接搜索安装就行) 2.建议建立一个新的maven项目,然后生成的文件直接移过去。如图: 3.pom配置文件 加依赖呗 <project xmlns="http://maven.apache.org/POM/ 阅读全文
posted @ 2017-09-23 14:56 qwer78 阅读(109) 评论(0) 推荐(0)
摘要:需求:使用MyBatis往MySQL数据库中插入一条记录后,需要返回该条记录的自增主键值。 方法:在mapper中指定keyProperty属性,示例如下: <insert id="addCoupon" parameterType="com.datebook.entity.Coupon" useGe 阅读全文
posted @ 2017-09-07 17:49 qwer78 阅读(77) 评论(0) 推荐(0)
摘要:1. findByIds(List ids) 1. 当查询的参数只有一个时 findByIds(List<Long> ids) 如果参数的类型是List, 则在使用时,collection属性要必须指定为 list <select id="findByIdsMap" resultMap="BaseR 阅读全文
posted @ 2017-08-26 09:35 qwer78 阅读(33) 评论(0) 推荐(0)
摘要:例如表 业务需求:将code的值设置为A+id的值 mysql命令:update permit_list setcode= concat('A',id) (更新字段信息: UPDATE permit_list SET OWNER= "admin;myself" WHERE CODE = "A0000 阅读全文
posted @ 2017-07-07 10:44 qwer78 阅读(43) 评论(0) 推荐(0)