优化xml文件sql

master
星期八 6 years ago
parent b9edde2fd2
commit 3552a70bf2
  1. 4
      src/main/java/com/lq/cms/service/impl/SysRoleResourcePermissionServiceImpl.java
  2. 2
      src/main/java/com/lq/cms/web/IndexController.java
  3. 47
      src/main/java/com/lq/code/WebSocket/AbstraceWebSocketHandler.java
  4. 28
      src/main/java/com/lq/code/WebSocket/CommoditySocket.java
  5. 23
      src/main/java/com/lq/code/WebSocket/MarcoHandler.java
  6. 17
      src/main/java/com/lq/code/WebSocket/MyWebSocketConfig.java
  7. 20
      src/main/java/com/lq/code/WebSocket/WebSorketHandler.java
  8. 9
      src/main/java/com/lq/code/util/CreateMapperFileUtil.java
  9. 6
      src/main/java/com/lq/code/util/Md5Util.java
  10. 3
      src/main/java/com/lq/code/util/StringUtil.java
  11. 4
      src/main/java/com/lq/code/util/sql/MysqlBuilder.java
  12. 8
      src/main/resources/mybatis/mapping/SysFileDao.xml
  13. 19
      src/main/resources/mybatis/mapping/SysLogDao.xml
  14. 8
      src/main/resources/mybatis/mapping/SysPermissionDao.xml
  15. 21
      src/main/resources/mybatis/mapping/SysResourceDao.xml
  16. 19
      src/main/resources/mybatis/mapping/SysRoleDao.xml
  17. 10
      src/main/resources/mybatis/mapping/SysRoleResourcePermissionDao.xml
  18. 24
      src/main/resources/mybatis/mapping/SysUserDao.xml
  19. 7
      src/main/resources/mybatis/mapping/SysUserRoleDao.xml
  20. 13
      src/main/resources/mybatis/mapping/WechatAccesstokenDao.xml
  21. 14
      src/main/resources/mybatis/mapping/WechatInfoDao.xml
  22. 21
      src/main/resources/mybatis/mappingTemplate.xml
  23. 2
      src/main/resources/spring-import.xml
  24. 16
      src/main/resources/spring/spring-websocket.xml
  25. 12
      src/main/webapp/WEB-INF/views/jsp/cms/info.jsp
  26. 1
      src/main/webapp/WEB-INF/views/jsp/cms/sys/menu/edit.jsp

@ -66,7 +66,7 @@ public class SysRoleResourcePermissionServiceImpl extends BaseServiceImpl<SysRol
ztreeItme1.setChecked(isCheck(resource.getId(), PermissionTyepEnum.SELECT.getValue(),roleId));
ztreeItme1.setAttributes(getAttributes(resource.getId(),PermissionTyepEnum.SELECT.getValue()));
for (SysPermission sysPermission:permissionList){
if (sysPermission.getId()==PermissionTyepEnum.SELECT.getValue()){
if (PermissionTyepEnum.SELECT.getValue().equals(sysPermission.getId())){
continue;
}
Ztree ztree=new Ztree();
@ -144,7 +144,7 @@ public class SysRoleResourcePermissionServiceImpl extends BaseServiceImpl<SysRol
//内部方法,用于判断角色是否有权限
private boolean isCheck(Long resourceId,Long permissionId,Long roleId){
SysRoleResourcePermission roleResourcePermission=sysRoleResourcePermissionDao.findByResourceIdAndPermissionIdAndRoleId(resourceId,permissionId,roleId);
if (roleResourcePermission!=null&&roleResourcePermission.getStatus()== StatusTypeEnum.STATUS_ACTIVITY_YES.getValue()){
if (roleResourcePermission!=null&&StatusTypeEnum.STATUS_ACTIVITY_YES.getValue().equals(roleResourcePermission.getStatus())){
return true;
}else{
return false;

@ -74,7 +74,7 @@ public class IndexController {
public ModelAndView toCmsInfo(ModelAndView modelAndView,HttpServletRequest request){
SysInfoVo vo = new SysInfoVo();
ServletContext context = request.getServletContext();
String userIp = request.getRemoteAddr();
String userIp = NetUtil.getIP();
context.getServerInfo();
DbInfo dbInfo = JdbcUtils.getDBInfo();
OsInfo osInfo = OsUtil.getInfo();

@ -1,47 +0,0 @@
package com.lq.code.WebSocket;
import org.springframework.web.socket.*;
/**
* Created by qi_liang on 2018/6/13.
*/
public abstract class AbstraceWebSocketHandler implements WebSocketHandler {
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
if (message instanceof TextMessage){
handleTextMessage(session, (TextMessage) message);
}
else if (message instanceof BinaryMessage){
handleBinaryMessage(session, (BinaryMessage) message);
}
else if (message instanceof PongMessage){
handlPongMessage(session, (PongMessage) message);
} else {
throw new IllegalStateException("Unexpected WebSocket message type"+message);
}
}
protected void handleTextMessage(WebSocketSession session,TextMessage message)throws Exception{
}
protected void handleBinaryMessage(WebSocketSession session, BinaryMessage message)throws Exception{
}
protected void handlPongMessage(WebSocketSession session,PongMessage message)throws Exception{
}
@Override
public void handleTransportError(WebSocketSession session, Throwable throwable) throws Exception {
}
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
}
}

@ -1,28 +0,0 @@
package com.lq.code.WebSocket;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;
/**
* Created by qi_liang on 2018/6/13.
*/
public class CommoditySocket extends TextWebSocketHandler {
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
System.out.println("open ......");
}
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
System.out.println("Close ........");
}
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
super.handleTextMessage(session, message);
System.out.println("接受到的消息是"+message.getPayload());
}
}

@ -1,23 +0,0 @@
package com.lq.code.WebSocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.AbstractWebSocketHandler;
/**
* Created by qi_liang on 2018/4/18.
*/
public class MarcoHandler extends AbstractWebSocketHandler {
private static final Logger logger = LoggerFactory.getLogger(MarcoHandler.class);
//文本消息 
protected void handleTextMessage(WebSocketSession session, TextMessage message)throws Exception{
logger.info("Received message:"+message.getPayload());
// Thread.sleep(2000); //  模拟延时
session.sendMessage(new TextMessage("Polo!")); //发送小
}
}

@ -1,17 +0,0 @@
package com.lq.code.WebSocket;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
/**
* Created by qi_liang on 2018/4/1.
*/
public class MyWebSocketConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry webSocketHandlerRegistry) {
}
}

@ -1,20 +0,0 @@
package com.lq.code.WebSocket;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession;
/**
* Created by qi_liang on 2018/6/13.
*/
public interface WebSorketHandler {
void alfterConeectionEstablished(WebSocketSession session)throws Exception;
void handlMessage(WebSocketSession session, WebSocketMessage message)throws Exception;
void handlTransportError(WebSocketSession session, CloseStatus closeStatus)throws Exception;
boolean supportsPartialMessages();
}

@ -17,18 +17,21 @@ public class CreateMapperFileUtil {
public static String createXML(String filePath,Class daoClazz,Class entityClazz,AbstractDbBuiler db){
String result=FileUtil.read(filePath);
//dao类名
result=result.replace("@DaoName",daoClazz.getName());
//实体名
result=result.replace("@BeanName",entityClazz.getName());
//表名
result=result.replace("@tableName", SqlUtil.beanNameToTableName(entityClazz));
StringBuffer columnBuffer=new StringBuffer();
StringBuffer attributeBuffer=new StringBuffer();
StringBuffer columnAndAttributeBuffer=new StringBuffer();
StringBuffer columnAndAttributeBuffer=new StringBuffer();
Map<String,String> map=SqlUtil.getAttributeAndColumn(entityClazz);
for (String key:map.keySet()){
attributeBuffer.append("#{"+key+"},");
columnBuffer.append(map.get(key)+",");
columnAndAttributeBuffer.append("\n <if test=\""+key+"!=null\">"+map.get(key)+"="+"#{"+key+"},</if>");
columnAndAttributeBuffer.append("\n <if test=\""+key+"!=null\">"+map.get(key)+"="+"#{"+key+"},</if>");
}
attributeBuffer.deleteCharAt(attributeBuffer.length()-1);
columnBuffer.deleteCharAt(columnBuffer.length()-1);
@ -36,10 +39,8 @@ public class CreateMapperFileUtil {
result=result.replace("@tableColumn",columnBuffer);
result=result.replace("@beanAttribute",attributeBuffer);
result=result.replace("@ColumnEqAttribute",columnAndAttributeBuffer);
return result;
}
public static void createXml(Class daoClazz,Class entityClazz,AbstractDbBuiler db)throws IOException {

@ -27,10 +27,12 @@ public class Md5Util {
StringBuffer buffer=new StringBuffer("");
for (int offset=0;offset<b.length;offset++){
i=b[offset];
if (i<0)
if (i<0) {
i+=256;
if (i<16)
}
if (i<16) {
buffer.append("0");
}
buffer.append(Integer.toHexString(i));
}
return buffer.toString();

@ -32,7 +32,7 @@ public class StringUtil {
if (str1==null){
return true;
}
if (str1==""||str1.equals("")){
if (str1==""||"".equals(str1)){
return true;
}
return false;
@ -72,6 +72,7 @@ public class StringUtil {
case 0:randomString.append(random.nextInt(10));break;
case 1:randomString.append(randomLowerCase());break;
case 2:randomString.append(randomUpperCase());break;
default: break;
}
length--;
}

@ -75,7 +75,7 @@ public class MysqlBuilder extends AbstractDbBuiler {
String column = SqlUtil.caseToHump(f.getName());
String columnType = dataTypeMap.get(f.getGenericType().toString());
String lengthStr = "";
if (columnType.equals("varchar") || columnType.equals("int")) {
if ("varchar".equals(columnType) || "int".equals(columnType)) {
Length length = f.getAnnotation(Length.class);
if (length != null) {
lengthStr = "(" + length.value() + ")";
@ -117,7 +117,7 @@ public class MysqlBuilder extends AbstractDbBuiler {
for (Map<String,String> map:mapList){
String dataTypeStr = dataTypeMap.get(map.get("fieldType"));
sql.append(SqlUtil.caseToHump(map.get("fieldName"))+" "+dataTypeStr);
if (dataTypeStr.equals("varchar")||dataTypeStr.equals("int")){
if ("varchar".equals(dataTypeStr)||"int".equals(dataTypeStr)){
if (map.containsKey("fieldLength")) {
sql.append("("+map.get("fieldLength")+")");

@ -5,12 +5,16 @@
<mapper namespace="com.lq.dao.SysFileDao">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,path,create_time,file_type,file_name,status
</sql>
<select id="findOne" resultType="com.lq.entity.SysFile" parameterType="long">
SELECT * FROM sys_file WHERE id=#{id}
SELECT <include refid="column_list"/> FROM sys_file WHERE id=#{id}
</select>
<select id="findAll" resultType="com.lq.entity.SysFile">
SELECT * FROM sys_file
SELECT <include refid="column_list"/> FROM sys_file
</select>
<insert id="save" parameterType="com.lq.entity.SysFile" useGeneratedKeys="true" keyProperty="id">

@ -5,21 +5,30 @@
<mapper namespace="com.lq.dao.SysLogDao">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,user_ip,create_time,url,status
</sql>
<select id="findOne" resultType="com.lq.entity.SysLog" parameterType="long">
SELECT * FROM sys_log WHERE id=#{id} AND status = 1
SELECT <include refid="column_list"/>
FROM sys_log
WHERE id=#{id} AND status = 1
</select>
<select id="count" resultType="int" parameterType="com.lq.cms.vo.SysLogVo">
SELECT count(*) FROM sys_log WHERE status = 1
SELECT count(id) FROM sys_log WHERE status = 1
</select>
<select id="findAll" resultType="com.lq.entity.SysLog">
SELECT * FROM sys_log
SELECT <include refid="column_list"/>
FROM sys_log
</select>
<select id="findListPage" resultType="com.lq.cms.vo.SysLogVo" parameterType="com.lq.cms.vo.SysLogVo">
SELECT * FROM sys_log ORDER BY create_time DESC
SELECT <include refid="column_list"/>
FROM sys_log
ORDER BY create_time DESC
</select>
<insert id="save" parameterType="com.lq.entity.SysLog">
@ -46,7 +55,5 @@
</delete>
</mapper>

@ -4,8 +4,14 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lq.dao.SysPermissionDao">
<sql id="column_list">
id,name,status
</sql>
<select id="findAll" resultType="com.lq.entity.SysPermission">
SELECT * FROM sys_permission WHERE status = 1
SELECT <include refid="column_list"/> FROM sys_permission WHERE status = 1
</select>
<insert id="save" parameterType="com.lq.entity.SysPermission">

@ -5,8 +5,13 @@
<mapper namespace="com.lq.dao.SysResourceDao">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,url_path,sort,parent_id,menu_ico,menu_name,create_time,update_time,user_id,status
</sql>
<select id="findByParentId" resultType="com.lq.entity.SysResource">
SELECT *
SELECT <include refid="column_list"/>
FROM sys_resource
WHERE
parent_id=#{parentId} AND status= 1
@ -14,18 +19,22 @@
</select>
<select id="findAll" resultType="com.lq.entity.SysResource">
SELECT *
SELECT <include refid="column_list"/>
FROM sys_resource
WHERE
status = 1
</select>
<select id="findList" parameterType="com.lq.cms.vo.SysResourceVo" resultType="com.lq.entity.SysResource">
SELECT * FROM sys_resource WHERE status =1
SELECT <include refid="column_list"/>
FROM sys_resource
WHERE status =1
</select>
<select id="findOne" parameterType="Long" resultType="com.lq.entity.SysResource">
SELECT * FROM sys_resource WHERE id=#{id} AND status = 1
SELECT <include refid="column_list"/>
FROM sys_resource
WHERE id=#{id} AND status = 1
</select>
<select id="findListPage" parameterType="com.lq.cms.vo.SysResourceVo" resultType="com.lq.cms.vo.SysResourceVo">
@ -39,7 +48,7 @@
<select id="count" parameterType="com.lq.cms.vo.SysResourceVo" resultType="int">
SELECT COUNT(*) FROM sys_resource WHERE status=1
SELECT COUNT(id) FROM sys_resource WHERE status=1
</select>
<update id="update" parameterType="com.lq.entity.SysResource">
@ -88,7 +97,7 @@
</insert>
<select id="findMenu" parameterType="map" resultType="com.lq.entity.SysResource">
SELECT *
SELECT <include refid="column_list"/>
FROM sys_resource t1
INNER JOIN (
SELECT DISTINCT resource_id

@ -6,6 +6,10 @@
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,role_name,create_time,update_time,status
</sql>
<select id="findByUserId" resultType="com.lq.entity.SysRole">
SELECT t1.* FROM sys_role t1
LEFT JOIN sys_user_role t2 ON t1.id=t2.role_id
@ -14,11 +18,16 @@
<select id="findOne" resultType="com.lq.entity.SysRole" parameterType="long">
SELECT * FROM sys_role WHERE id=#{id} AND status=1
SELECT <include refid="column_list"/>
FROM sys_role
WHERE id=#{id}
AND status=1
</select>
<select id="findAll" resultType="com.lq.entity.SysRole">
SELECT * FROM sys_role WHERE status=1
SELECT <include refid="column_list"/>
FROM sys_role
WHERE status=1
</select>
<insert id="save" parameterType="com.lq.entity.SysRole" useGeneratedKeys="true" keyProperty="id">
@ -54,11 +63,13 @@
</update>
<select id="count" resultType="Int" parameterType="com.lq.cms.vo.SysRoleVo">
SELECT count(*) FROM sys_role WHERE status=1
SELECT count(id) FROM sys_role WHERE status=1
</select>
<select id="findListPage" parameterType="com.lq.cms.vo.SysRoleVo" resultType="com.lq.cms.vo.SysRoleVo">
SELECT * FROM sys_role WHERE status=1
SELECT <include refid="column_list"/>
FROM sys_role
WHERE status=1
</select>

@ -6,6 +6,10 @@
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,permission_id,resource_id,role_id,create_time,status
</sql>
<select id="findByRoleId" resultType="com.lq.cms.vo.PermissionVo">
SELECT t2.id menu_id,t2.url_path menuUrl,t2.menu_name,t3.name permission_name FROM sys_role_resource_permission t1
LEFT JOIN sys_resource t2 ON t1.resource_id=t2.id
@ -46,7 +50,8 @@
</update>
<select id="findByResourceIdAndPermissionIdAndRoleId" resultType="com.lq.entity.SysRoleResourcePermission">
SELECT * FROM sys_role_resource_permission
SELECT <include refid="column_list"/>
FROM sys_role_resource_permission
WHERE 1=1
AND resource_id=#{resourceId}
AND permission_id=#{permissonId}
@ -72,7 +77,4 @@
</update>
</mapper>

@ -6,26 +6,38 @@
<!-- 开启mybatis的二级缓存-->
<!--<cache eviction="FIFO" flushInterval="60000" size="512" readOnly="true"/>
-->
<sql id="column_list">
id,login_name,password,create_time,update_time,last_login_time,email,img_url,remarks,status
</sql>
<select id="findOne" parameterType="Long" resultType="com.lq.entity.SysUser">
SELECT * FROM sys_user
SELECT <include refid="column_list"/>
FROM sys_user
WHERE id=#{id}
AND status = 1
AND status = 1
</select>
<select id="findByEmail" resultType="com.lq.entity.SysUser">
SELECT * FROM sys_user where email = #{email} AND status = 1
SELECT <include refid="column_list"/>
FROM sys_user
where email = #{email} AND status = 1
</select>
<select id="findByLoginNameAndPassword" resultType="com.lq.entity.SysUser" >
SELECT * FROM sys_user t WHERE t.login_name=#{loginName} AND t.password=#{password} AND t.status =1
SELECT <include refid="column_list"/>
FROM sys_user t
WHERE t.login_name=#{loginName} AND t.password=#{password} AND t.status =1
</select>
<select id="findListPage" resultType="com.lq.cms.vo.SysUserVo" parameterType="com.lq.cms.vo.SysUserVo">
SELECT * FROM sys_user WHERE status = 1
SELECT <include refid="column_list"/>
FROM sys_user
WHERE status = 1
</select>
<select id="count" parameterType="com.lq.cms.vo.SysUserVo" resultType="Int">
SELECT count(*) FROM sys_user WHERE status =1
SELECT count(id) FROM sys_user WHERE status =1
</select>
<insert id="save" parameterType="com.lq.entity.SysUser" useGeneratedKeys="true" keyProperty="id">

@ -6,8 +6,13 @@
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
user_id, role_id, create_time, update_time,status
</sql>
<select id="findByUserIdAndRoleId" parameterType="Map" resultType="com.lq.entity.SysUserRole">
SELECT * FROM sys_user_role WHERE 1=1
SELECT <include refid="column_list"/>
FROM sys_user_role WHERE 1=1
<if test="userId != null"> AND user_id=#{userId}</if>
<if test="roleId != null">AND role_id=#{roleId}</if>
</select>

@ -5,12 +5,21 @@
<mapper namespace="com.lq.dao.WechatAccesstokenDao">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,create_time,wechat_info_id,access_tokne,last_update_time
</sql>
<select id="findOne" resultType="com.lq.entity.WechatAccesstoken" parameterType="long">
SELECT * FROM wechat_accesstoken WHERE id=#{id} AND status = 1
SELECT <include refid="column_list"/>
FROM wechat_accesstoken
WHERE id=#{id} AND status = 1
</select>
<select id="findAll" resultType="com.lq.entity.WechatAccesstoken">
SELECT * FROM wechat_accesstoken WHERE status = 1
SELECT <include refid="column_list"/>
FROM wechat_accesstoken
WHERE status = 1
</select>
<insert id="save" parameterType="com.lq.entity.WechatAccesstoken" useGeneratedKeys="true" keyProperty="id">

@ -5,12 +5,16 @@
<mapper namespace="com.lq.dao.WechatInfoDao">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
id,wechat_open_id,app_secpet,create_time,app_id,encoding_type,wechat_name,url,token,encoding_aes_key,last_update_time,status
</sql>
<select id="findOne" resultType="com.lq.entity.WechatInfo" parameterType="long">
SELECT * FROM wechat_info WHERE id=#{id} AND status = 1
SELECT <include refid="column_list"/> FROM wechat_info WHERE id=#{id} AND status = 1
</select>
<select id="findAll" resultType="com.lq.entity.WechatInfo">
SELECT * FROM wechat_info WHERE status = 1
SELECT <include refid="column_list"/> FROM wechat_info WHERE status = 1
</select>
<insert id="save" parameterType="com.lq.entity.WechatInfo" useGeneratedKeys="true" keyProperty="id">
@ -54,15 +58,15 @@
WHERE
id=#{id}
AND
status = 1
status = 1
</delete>
<select id="count" resultType="int" parameterType="com.lq.cms.vo.WechatInfoVo">
SELECT count(*) FROM wechat_info
SELECT count(id) FROM wechat_info
</select>
<select id="findListPage" parameterType="com.lq.cms.vo.WechatInfoVo" resultType="com.lq.cms.vo.WechatInfoVo">
SELECT t1.*
SELECT <include refid="column_list"/>
FROM wechat_info t1
WHERE status = 1
ORDER BY t1.create_time DESC

@ -5,16 +5,27 @@
<mapper namespace="@DaoName">
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 -->
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用-->
<sql id="column_list">
@tableColumn
</sql>
<select id="findOne" resultType="@BeanName" parameterType="long">
SELECT * FROM @tableName WHERE id=#{id} AND status = 1
SELECT <include refid="column_list"/>
FROM @tableName
WHERE id=#{id} AND status = 1
</select>
<select id="findAll" resultType="@BeanName">
SELECT * FROM @tableName WHERE status = 1
SELECT <include refid="column_list"/>
FROM @tableName
WHERE status = 1
</select>
<select id="count" resultType="int">
SELECT count(*) FROM @tableName WHERE status = 1
SELECT count(id)
FROM @tableName
WHERE status = 1
</select>
<insert id="save" parameterType="@BeanName" useGeneratedKeys="true" keyProperty="id">
@ -45,11 +56,9 @@
UPDATE
FROM @tableName
SET
status = 0
status = 0
WHERE
id=#{id}
</update>
</mapper>

@ -15,5 +15,5 @@
<import resource="classpath:spring/spring-email.xml"></import>
<!-- websocket -->
<import resource="classpath:spring/spring-websocket.xml"/>
<!--<import resource="classpath:spring/spring-websocket.xml"/>-->
</beans>

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:websocket="http://www.springframework.org/schema/websocket"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/websocket
http://www.springframework.org/schema/websocket/spring-websocket.xsd ">
<websocket:handlers>
<websocket:mapping path="/marcohandler" handler="marcoHandler"/>
</websocket:handlers>
<bean id="marcoHandler" class="com.lq.code.WebSocket.MarcoHandler"/>
</beans>

@ -88,18 +88,6 @@
<td>操作系统:</td>
<td>${sysInfoVo.osInfo.osName} ${sysInfoVo.osInfo.osVersion}</td>
</tr>
<tr>
<td>用户的主目录:</td>
<td>4核</td>
</tr>
<tr>
<td>工作目录</td>
<td>476M</td>
</tr>
<tr>
<td>系统目录</td>
<td></td>
</tr>
</table>
</div>

@ -16,6 +16,7 @@
$("#menuIco").val('${sysResource.menuIco}');
})
</script>
<link href="${ctx}/resources/aceAdmin/assets/css/font-awesome.min.css">
</head>
<body>
<div style="margin:20px 0;"></div>

Loading…
Cancel
Save