随笔分类 -  mysql

MYSQL批量插入字段空值赋值0
摘要:<insert id="insertReignFromReport"> <foreach collection="departIdLst" item="item" index="index" open="" close="" separator=";"> insert into t_preparat 阅读全文

posted @ 2019-11-07 15:23 以启山林 阅读(1388) 评论(0) 推荐(0)

MYSQL多字段条件模糊查询
摘要:select mo.id as id, mo.name as name, mo.user_id as userId, mo.actual_name as actualName, mo.login_ip as loginIp, mo.las... 阅读全文

posted @ 2019-09-03 17:25 以启山林 阅读(3549) 评论(0) 推荐(0)

MYSQL采用union all 合并去重,相同值累加
摘要:查询结果如下: 采用Java算法,合并相同的personType,并且各字段结果累加,如下: 最终结果集如下: 阅读全文

posted @ 2019-07-25 18:30 以启山林 阅读(7149) 评论(0) 推荐(0)

MYSQL查询用户下多个角色信息
摘要:<resultMap id="baseBeanUser" type="com.**.**.vo.system.TUserVoOut"> <id column="id" property="id"/> <result column="name" property="name"/> <result co 阅读全文

posted @ 2019-07-17 10:44 以启山林 阅读(2214) 评论(0) 推荐(0)

MYSQL批量更新
摘要:1,配置 &allowMultiQueries=true 即:将数据库配置修改为 jdbc.url=jdbc:mysql://127.0.0.1:3306/datebase?useUnicode=true&characterEncoding=UTF- 8&autoReconnect=true&all 阅读全文

posted @ 2019-07-16 15:40 以启山林 阅读(2010) 评论(0) 推荐(0)

MYSQL根据当前节点查询父子节点
摘要:-- 根据部门ID获取父ID 2019-07-08 drop function f_getDepartmentParent; DELIMITER ;; CREATE DEFINER=`root`@`locahost` FUNCTION `f_getDepartmentParent`(departmentId BIGINT(20)) RETURNS varchar(1000) CHARSET ut... 阅读全文

posted @ 2019-07-15 16:47 以启山林 阅读(1516) 评论(0) 推荐(0)

MYSQL多表关联分组查询统计数量
摘要:<resultMap id="baseAmount" type="***.***VO"> <result column="id" property="id"/> <result column="personType" property="personType"/> <result column="p 阅读全文

posted @ 2019-07-15 13:53 以启山林 阅读(15159) 评论(1) 推荐(1)

导航