SpringBoot开发时的一些注意点
公司新项目要用Java Web
公司新项目要用Java Web,学习是必须的,故而本文记录SpringBoot开发中遇到的各种问题及常用配置。
持续更新直至项目完结。
热更新
File -> Setting -> Build,Execution, Deployment -> Compiler
打钩: Build Project Automatically
Ctrl+Alt+Shift+/
打钩: Register -> compiler.automake.allow.when.app.running
Idea配置
File -> Setting -> Plugins -> IDE Eval Reset
最近忙的飞起
先记录下我需要备注的东西
mybatis一对多查询
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jhit.zjrd.dms.dao.UserMapper">
<!-- 一对多查询-->
<select id="getByUserName" parameterType="java.lang.String" resultType="com.jhit.zjrd.dms.security.support.UserDetail" resultMap="userDetailResultMap">
SELECT T1.ID,T1.GROUPID,T1.NAME,T1.USERNAME,T1.N,T1.PASSWORD,T1.MOBILE,T1.MD5,T1.OPENID,T1.CREATETIME,T1.VALID,
T3.ID ROLEID,T3.NAME ROLENAME,
T5.ID MENUID,T5.NAME MENUNAME,T5.URL,T5.APPURL
FROM DMS.USERS T1
INNER JOIN DMS.USER_ROLES T2 ON T1.ID=T2.USERID
INNER JOIN DMS.ROLES T3 ON T2.ROLEID=T3.ID
INNER JOIN DMS.ROLE_MENUS T4 ON T3.ID=T4.ROLEID
INNER JOIN DMS.MENUS T5 ON T4.MENUID=T5.ID
WHERE T1.USERNAME = #{userName}
</select>
<resultMap id="userDetailResultMap" type="com.jhit.zjrd.dms.security.support.UserDetail" autoMapping="true">
<id property="ID" column="ID" javaType="Integer"/>
<collection property="roleList" ofType="com.jhit.zjrd.dms.security.support.RoleDetail" javaType="java.util.List" autoMapping="true">
<id property="ID" column="ROLEID" javaType="String"/>
<id property="NAME" column="ROLENAME" javaType="String"/>
<collection property="menuList" ofType="com.jhit.zjrd.dms.model.entity.Menu" javaType="java.util.List" autoMapping="true">
<id property="ID" column="MENUID" javaType="String"/>
<id property="NAME" column="MENUNAME" javaType="String"/>
</collection>
</collection>
</resultMap>
</mapper>