瀏覽代碼

Merge branch 'master' of http://hefeng@124.193.70.90:1001/r/depot-system-yunnan.git

hefeng 5 年之前
父節點
當前提交
33333c8c7f

+ 13 - 0
pom.xml

@@ -118,6 +118,19 @@
118 118
             <artifactId>spring-boot-starter-test</artifactId>
119 119
             <scope>test</scope>
120 120
         </dependency>
121
+        <!-- 阿里巴巴json -->
122
+		<dependency>
123
+			<groupId>com.alibaba</groupId>
124
+			<artifactId>fastjson</artifactId>
125
+			<version>1.2.37</version>
126
+		</dependency>
127
+        <!-- 加载mybatis逆向生成工具包 -->
128
+        <dependency>
129
+		    <groupId>org.mybatis.generator</groupId>
130
+		    <artifactId>mybatis-generator-core</artifactId>
131
+		    <!-- 注意版本.这里我使用的是1.3.2 -->
132
+		    <version>1.3.2</version>
133
+		</dependency>
121 134
     </dependencies>
122 135
 
123 136
     <dependencyManagement>

+ 27 - 0
src/main/java/com/chinaitop/depot/InterceptorConfig.java

@@ -0,0 +1,27 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
6
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
7
+
8
+@Configuration
9
+public class InterceptorConfig extends WebMvcConfigurationSupport {
10
+
11
+	@Bean
12
+	public LogercostInterceptor getInterceptor() {
13
+		return new LogercostInterceptor();
14
+	}
15
+	/**
16
+     * interceptor配置
17
+     */
18
+    @Override
19
+    public void addInterceptors(InterceptorRegistry registry) {
20
+
21
+    	//添加需要验证登录用户操作权限的请求
22
+        registry.addInterceptor(getInterceptor()).addPathPatterns("/**");
23
+
24
+        //这里可以用registry.addInterceptor添加多个拦截器实例,后面加上匹配模式
25
+        //super.addInterceptors(registry);//最后将register往这里塞进去就可以了
26
+    }
27
+}

+ 309 - 0
src/main/java/com/chinaitop/depot/LogercostInterceptor.java

@@ -0,0 +1,309 @@
1
+package com.chinaitop.depot;
2
+
3
+import java.util.Date;
4
+import java.util.HashMap;
5
+import java.util.Iterator;
6
+import java.util.List;
7
+import java.util.Map;
8
+import java.util.Set;
9
+import java.util.UUID;
10
+
11
+import javax.servlet.http.HttpServletRequest;
12
+import javax.servlet.http.HttpServletResponse;
13
+
14
+import org.apache.commons.lang.ObjectUtils;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.lang.Nullable;
17
+import org.springframework.web.method.HandlerMethod;
18
+import org.springframework.web.servlet.HandlerInterceptor;
19
+import org.springframework.web.servlet.ModelAndView;
20
+
21
+import com.alibaba.fastjson.JSONArray;
22
+import com.alibaba.fastjson.JSONObject;
23
+import com.chinaitop.depot.system.mapper.SystemLogMapper;
24
+import com.chinaitop.depot.system.model.SystemLog;
25
+import com.chinaitop.depot.system.model.SystemLogExample;
26
+import com.chinaitop.depot.utils.RedisUtil;
27
+
28
+/**
29
+ * 功能日志拦截器
30
+ * 
31
+ * @author fanxiongwei
32
+ *
33
+ */
34
+public class LogercostInterceptor implements HandlerInterceptor {
35
+
36
+	private static String system_index = "库级系统";
37
+
38
+	@Autowired
39
+	private RedisUtil redisUtil;
40
+	
41
+	@Autowired
42
+	private SystemLogMapper systemLogMapper;
43
+
44
+	/**
45
+     * preHandle是在请求执行前执行的
46
+     */
47
+    @Override
48
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
49
+
50
+    	//获取URL
51
+        String url = request.getRequestURI();
52
+    	//注销日志
53
+    	if ("/userInfo/exitLogin".equals(url)) {
54
+    		loginLogger(request, response, url);
55
+    	}
56
+    	
57
+        //System.out.println(butn_list);
58
+        
59
+        //System.out.println("Interception cost="+(System.currentTimeMillis()-start));
60
+        return true;//返回true,postHandler和afterCompletion方法才能执行,否则false为拒绝执行,起到拦截器控制作用
61
+    }
62
+
63
+    /**
64
+     * postHandler是在请求结束之后,视图渲染之前执行的,但只有preHandle方法返回true的时候才会执行
65
+     */
66
+    @Override
67
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception {
68
+    	//获取URL
69
+        String url = request.getRequestURI();
70
+        //获取用户信息和单位信息
71
+        String userJson = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
72
+        String orgInfoJson = ObjectUtils.toString(request.getSession().getAttribute("orgInfo"),"");
73
+        //登录日志
74
+    	if (("/userInfo/login".equals(url) || "/userInfo/exitLogin".equals(url))
75
+    			&& !"".equals(userJson) && !"".equals(orgInfoJson)
76
+    			&& null != userJson && null != orgInfoJson) {
77
+    		loginLogger(request, response, url);
78
+    	}
79
+    	//功能操作和访问日志
80
+    	if (!"/userInfo/login".equals(url) && !"/userInfo/exitLogin".equals(url)
81
+    			&& !"".equals(userJson) && !"".equals(orgInfoJson)
82
+    			&& null != userJson && null != orgInfoJson) {
83
+    		operationLogger(request, response, url, handler);
84
+    	}
85
+    }
86
+
87
+    /**
88
+     * 封装登录信息
89
+     * 
90
+     * @param userJson
91
+     * @param orgInfoJson
92
+     * @return
93
+     */
94
+    private Map<String, String> getUserOrgInfo(String userJson, String orgInfoJson) {
95
+    	Map<String, String> user_map = new HashMap<String, String>();
96
+    	JSONObject userinfo = JSONObject.parseObject(userJson);
97
+    	JSONObject orginfo = JSONObject.parseObject(orgInfoJson);
98
+    	user_map.put("userId", userinfo == null ? "" : userinfo.get("userId")+"");
99
+    	user_map.put("username", userinfo == null ? "" : userinfo.get("username")+"");
100
+    	user_map.put("realName", userinfo == null ? "" : userinfo.get("realName")+"");
101
+    	user_map.put("orgId", userinfo == null ? "" : userinfo.get("orgId")+"");
102
+    	user_map.put("roleName", userinfo == null ? "" : userinfo.get("roleNames")+"");
103
+    	user_map.put("areaName", orginfo == null ? "":ObjectUtils.toString(orginfo.get("areaName")+"",""));
104
+    	user_map.put("orgName", orginfo == null ? "":ObjectUtils.toString(orginfo.get("orgName")+"",""));
105
+		return user_map;
106
+	}
107
+
108
+    /**
109
+     * 登录日志(包含登录与注销)
110
+     * @param request
111
+     * @param response
112
+     */
113
+    private void loginLogger(HttpServletRequest request, HttpServletResponse response, String url) {
114
+    	//获取用户信息和单位信息
115
+        String userJson = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
116
+        String orgInfoJson = ObjectUtils.toString(request.getSession().getAttribute("orgInfo"),"");
117
+    	//登录
118
+        if ("/userInfo/login".equals(url)) {
119
+	    	SystemLog log = new SystemLog();
120
+	    	Map<String, String> user_map = getUserOrgInfo(userJson, orgInfoJson);
121
+			log.setSystemIdentify(system_index);
122
+			log.setUserZh(ObjectUtils.toString(user_map.get("username"),""));//账号
123
+			log.setUserName(ObjectUtils.toString(user_map.get("realName"),""));//名称
124
+			log.setDeviceIp(getClientIpAddress(request));
125
+			log.setDlTime(new Date());
126
+			log.setUserRole(ObjectUtils.toString(user_map.get("roleName"),""));//角色
127
+			log.setOrgId(Integer.parseInt(user_map.get("orgId")));//单位
128
+			log.setUserAddress(user_map.get("areaName"));//行政区划
129
+			log.setId(UUID.randomUUID().toString().replace("-", ""));
130
+			log.setUserId(Integer.parseInt(user_map.get("userId")));
131
+			log.setOperationTime(new Date());//操作时间
132
+			log.setType("1");
133
+
134
+			//添加保存日志
135
+			systemLogMapper.insert(log);
136
+    	}
137
+
138
+        //注销
139
+        if ("/userInfo/exitLogin".equals(url)) {
140
+        	if (null != userJson && null != orgInfoJson
141
+        			&& !"".equals(userJson) && !"".equals(orgInfoJson)) {
142
+        		Map<String, String> user_map = getUserOrgInfo(userJson, orgInfoJson);
143
+        		//修改条件
144
+        		SystemLogExample example = new SystemLogExample();
145
+        		SystemLogExample.Criteria criteria = example.createCriteria();
146
+        		criteria.andUserZhEqualTo(ObjectUtils.toString(user_map.get("username"),""));
147
+        		criteria.andOrgIdEqualTo(Integer.parseInt(user_map.get("orgId")));
148
+        		criteria.andTypeEqualTo("1");
149
+        		example.setOrderByClause(" dl_time desc");
150
+        		List<SystemLog> list = systemLogMapper.selectByExample(example);
151
+
152
+        		if (null != list && list.size() > 0) {
153
+        			//注销时间
154
+        			list.get(0).setZxTime(new Date());
155
+        			list.get(0).setOperationTime(new Date());//操作时间
156
+
157
+        			//修改登录日志信息
158
+        			systemLogMapper.updateByPrimaryKey(list.get(0));
159
+        		}
160
+        	}
161
+    		
162
+    	}
163
+    }
164
+    
165
+    /**
166
+     * 操作日志实现思路:
167
+     * 1、URL要是可以在菜单里面找到对应菜单,那么当前这个操作属于功能操作日志
168
+     * 2、如果没在菜单里面找到对应菜单,却在按钮中找到了,那么就是功能访问日志
169
+     * 3、如果菜单和按钮中都没有找到对应的URL,那么说明当前这个方位没在功能管理里面配置正确,或者没有加入到功能管理中
170
+     * 
171
+     * @param request
172
+     * @param response
173
+     * @param url
174
+     */
175
+    private void operationLogger(HttpServletRequest request, HttpServletResponse response, String url, Object handler) {
176
+    	//获取用户信息和单位信息
177
+        String userJson = ObjectUtils.toString(request.getSession().getAttribute("userInfo"),"");
178
+        String orgInfoJson = ObjectUtils.toString(request.getSession().getAttribute("orgInfo"),"");
179
+        Map<String, String> user_map = getUserOrgInfo(userJson, orgInfoJson);
180
+
181
+        //是否还需要继续往下执行
182
+        boolean flag = false;
183
+
184
+    	//获取菜单权限并且组装功能日志
185
+    	String func_list = (String) redisUtil.get("hasFuncList");
186
+    	JSONArray array = JSONArray.parseArray(func_list);
187
+    	if (null != array && array.size() > 4) {
188
+    		JSONObject object = null;
189
+    		SystemLog log = new SystemLog();
190
+    		for (Iterator iterator = array.iterator(); iterator.hasNext();) {
191
+    			object = (JSONObject) iterator.next();
192
+    			String func_url = ObjectUtils.toString(object.get("funcUrl"));
193
+    			if (url.equals(func_url)) {
194
+    				log.setId(UUID.randomUUID().toString().replace("-", ""));
195
+    				log.setType("3");//功能操作日志
196
+    				log.setSystemIdentify(system_index);//标识
197
+    				log.setUserId(Integer.parseInt(user_map.get("userId")));//用户ID
198
+    				log.setUserZh(ObjectUtils.toString(user_map.get("username"),""));//账号
199
+    				log.setUserName(ObjectUtils.toString(user_map.get("realName"),""));//名称
200
+    				log.setDeviceIp(getClientIpAddress(request));//操作IP
201
+    				log.setFuncName(ObjectUtils.toString(object.get("funcName")));//功能名称
202
+    				log.setOperationTime(new Date());//操作时间
203
+    				log.setUserRole(ObjectUtils.toString(user_map.get("roleName"),""));//角色
204
+    				log.setOrgId(Integer.parseInt(user_map.get("orgId")));//单位
205
+    				log.setUserAddress(user_map.get("areaName"));//行政区划
206
+
207
+    				//添加保存日志
208
+    				systemLogMapper.insert(log);
209
+
210
+    				//已经是操作日志了,那么没必要在遍历按钮了
211
+    				flag = true;
212
+    				//也不用继续当前循环了
213
+    				break;
214
+    			}
215
+    		}
216
+    	}
217
+        //获取按钮权限并且组装访问日志
218
+    	if (!flag) {
219
+    		String perm_list = (String) redisUtil.get("permissionList");
220
+    		JSONArray but_array = JSONArray.parseArray(perm_list);
221
+        	if (null != but_array && but_array.size() > 4) {
222
+        		JSONObject but_object = null;
223
+        		SystemLog log = new SystemLog();
224
+        		for (Iterator iterator = but_array.iterator(); iterator.hasNext();) {
225
+        			but_object = (JSONObject) iterator.next();
226
+        			if (but_object == null) {
227
+        				continue;
228
+        			}
229
+        			String but_url = ObjectUtils.toString(but_object.get("btnUrl"), "");
230
+        			if (url.equals(but_url)) {
231
+        				log.setId(UUID.randomUUID().toString().replace("-", ""));
232
+        				log.setType("2");//功能访问日志
233
+        				log.setSystemIdentify(system_index);//标识
234
+        				log.setUserId(Integer.parseInt(user_map.get("userId")));//用户ID
235
+        				log.setUserZh(ObjectUtils.toString(user_map.get("username"),""));//账号
236
+        				log.setUserName(ObjectUtils.toString(user_map.get("realName"),""));//名称
237
+        				log.setDeviceIp(getClientIpAddress(request));//操作IP
238
+        				String f_name = ObjectUtils.toString(but_object.get("funcName"), "");
239
+        				String b_name = ObjectUtils.toString(but_object.get("btnName"), "");
240
+        				String ramark = ObjectUtils.toString(but_object.get("remark"), "");
241
+        				StringBuffer sbf = new StringBuffer();
242
+        				if (!"".equals(ramark)) {
243
+        					sbf.append(f_name).append("功能").append(ramark).append("操作");
244
+        				} else {
245
+        					sbf.append(f_name).append("功能").append(b_name).append("操作");
246
+        				}
247
+        				log.setFuncName(ObjectUtils.toString(sbf.toString(), ""));//菜单名称
248
+        				HandlerMethod h = (HandlerMethod) handler;  
249
+        				log.setMethodName(h.getMethod().getName());//方法名
250
+        				log.setUserRole(ObjectUtils.toString(user_map.get("roleName"),""));//角色
251
+        				log.setOperationTime(new Date());//操作时间
252
+        				StringBuilder param = new StringBuilder();
253
+                        Map<String,String[]> map = request.getParameterMap();
254
+                        Set<String> key = map.keySet();
255
+                        for (String eachKey: key) {
256
+                            param.append(eachKey+"="+map.get(eachKey)[0]+"; ");
257
+                        }
258
+        				log.setParameter(param.toString());//传入参数
259
+
260
+        				String status = ObjectUtils.toString(response.getStatus(), "");
261
+        				log.setOperResult(status);//操作结果状态
262
+        				if ("200".equals(status)) {
263
+        					log.setRtnParam("请求成功");//返回参数
264
+        				} else {
265
+        					log.setRtnParam("请求失败");//返回参数
266
+        				}
267
+        				log.setOrgId(Integer.parseInt(user_map.get("orgId")));//所属机构
268
+        				log.setUserAddress(user_map.get("areaName"));//行政区划
269
+
270
+        				//添加保存日志
271
+        				systemLogMapper.insert(log);
272
+
273
+        				//中断本次循环
274
+        				break;
275
+        			}
276
+        		}
277
+        	}
278
+    	}
279
+    }
280
+
281
+	/**
282
+     * afterCompletion是视图渲染完成之后才执行,同样需要preHandle返回true,
283
+     */
284
+    @Override
285
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
286
+        //该方法通常用于清理资源等工作
287
+    }
288
+
289
+    /**
290
+     * 获取客户端IP
291
+     * 
292
+     * @param request
293
+     * @return
294
+     */
295
+    private String getClientIpAddress(HttpServletRequest request) {  
296
+        String clientIp = request.getHeader("x-forwarded-for");  
297
+        if(clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {  
298
+            clientIp = request.getHeader("Proxy-Client-IP");  
299
+        }  
300
+        if(clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {  
301
+            clientIp = request.getHeader("WL-Proxy-Client-IP");  
302
+        }  
303
+        if(clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {  
304
+            clientIp = request.getRemoteAddr();  
305
+        }  
306
+        return "0:0:0:0:0:0:0:1".equals(clientIp) ? "127.0.0.1" : clientIp;  
307
+    }
308
+
309
+}

+ 8 - 0
src/main/java/com/chinaitop/depot/system/mapper/RoleButtonMapper.java

@@ -5,6 +5,7 @@ import com.chinaitop.depot.system.model.RoleButtonExample;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 public interface RoleButtonMapper {
10 11
     int countByExample(RoleButtonExample example);
@@ -30,4 +31,11 @@ public interface RoleButtonMapper {
30 31
     int updateByPrimaryKey(RoleButton record);
31 32
     
32 33
     int batchInsert(List<RoleButton> list);
34
+
35
+    /**
36
+     * 查询按钮权限和按钮对应菜单和URL
37
+     * @param example
38
+     * @return
39
+     */
40
+    List<RoleButton> selectByExampleNew(Map<String, Object> param);
33 41
 }

+ 13 - 0
src/main/java/com/chinaitop/depot/system/mapper/RoleButtonMapper.xml

@@ -185,4 +185,17 @@
185 185
       btn_id = #{btnId,jdbcType=INTEGER}
186 186
     where rb_id = #{rbId,jdbcType=INTEGER}
187 187
   </update>
188
+  <!-- 查询按钮权限和按钮对应菜单和URL -->
189
+  <select id="selectByExampleNew" resultMap="BaseResultMap" parameterType="java.util.Map" >
190
+    SELECT 
191
+    a.rb_id, a.role_id, a.btn_id, b.func_id funcId, c.func_name funcName, b.btn_name btnName, b.remark,b.btn_url btnUrl 
192
+    FROM role_button a
193
+	LEFT JOIN button_info b on b.btn_id=a.btn_id 
194
+	LEFT JOIN func_info c ON c.func_id=b.func_id 
195
+	WHERE 1=1 
196
+    <if test="roleIds != null" >
197
+	AND a.role_id in ${roleIds}
198
+    </if>
199
+  </select>
200
+  
188 201
 </mapper>

+ 30 - 0
src/main/java/com/chinaitop/depot/system/mapper/SystemLogMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.system.mapper;
2
+
3
+import com.chinaitop.depot.system.model.SystemLog;
4
+import com.chinaitop.depot.system.model.SystemLogExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface SystemLogMapper {
9
+    int countByExample(SystemLogExample example);
10
+
11
+    int deleteByExample(SystemLogExample example);
12
+
13
+    int deleteByPrimaryKey(String id);
14
+
15
+    int insert(SystemLog record);
16
+
17
+    int insertSelective(SystemLog record);
18
+
19
+    List<SystemLog> selectByExample(SystemLogExample example);
20
+
21
+    SystemLog selectByPrimaryKey(String id);
22
+
23
+    int updateByExampleSelective(@Param("record") SystemLog record, @Param("example") SystemLogExample example);
24
+
25
+    int updateByExample(@Param("record") SystemLog record, @Param("example") SystemLogExample example);
26
+
27
+    int updateByPrimaryKeySelective(SystemLog record);
28
+
29
+    int updateByPrimaryKey(SystemLog record);
30
+}

+ 465 - 0
src/main/java/com/chinaitop/depot/system/mapper/SystemLogMapper.xml

@@ -0,0 +1,465 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.system.mapper.SystemLogMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.system.model.SystemLog" >
5
+    <id column="id" property="id" jdbcType="VARCHAR" />
6
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
7
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
8
+    <result column="user_zh" property="userZh" jdbcType="VARCHAR" />
9
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
10
+    <result column="user_role" property="userRole" jdbcType="VARCHAR" />
11
+    <result column="user_address" property="userAddress" jdbcType="VARCHAR" />
12
+    <result column="dl_time" property="dlTime" jdbcType="TIMESTAMP" />
13
+    <result column="zx_time" property="zxTime" jdbcType="TIMESTAMP" />
14
+    <result column="func_id" property="funcId" jdbcType="INTEGER" />
15
+    <result column="func_name" property="funcName" jdbcType="VARCHAR" />
16
+    <result column="btn_id" property="btnId" jdbcType="INTEGER" />
17
+    <result column="method_name" property="methodName" jdbcType="VARCHAR" />
18
+    <result column="oper_result" property="operResult" jdbcType="VARCHAR" />
19
+    <result column="parameter" property="parameter" jdbcType="VARCHAR" />
20
+    <result column="rtn_param" property="rtnParam" jdbcType="VARCHAR" />
21
+    <result column="describes" property="describes" jdbcType="VARCHAR" />
22
+    <result column="type" property="type" jdbcType="VARCHAR" />
23
+    <result column="device_ip" property="deviceIp" jdbcType="VARCHAR" />
24
+    <result column="system_identify" property="systemIdentify" jdbcType="VARCHAR" />
25
+    <result column="operation_time" property="operationTime" jdbcType="TIMESTAMP" />
26
+  </resultMap>
27
+  <sql id="Example_Where_Clause" >
28
+    <where >
29
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
30
+        <if test="criteria.valid" >
31
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
32
+            <foreach collection="criteria.criteria" item="criterion" >
33
+              <choose >
34
+                <when test="criterion.noValue" >
35
+                  and ${criterion.condition}
36
+                </when>
37
+                <when test="criterion.singleValue" >
38
+                  and ${criterion.condition} #{criterion.value}
39
+                </when>
40
+                <when test="criterion.betweenValue" >
41
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
42
+                </when>
43
+                <when test="criterion.listValue" >
44
+                  and ${criterion.condition}
45
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
46
+                    #{listItem}
47
+                  </foreach>
48
+                </when>
49
+              </choose>
50
+            </foreach>
51
+          </trim>
52
+        </if>
53
+      </foreach>
54
+    </where>
55
+  </sql>
56
+  <sql id="Update_By_Example_Where_Clause" >
57
+    <where >
58
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
59
+        <if test="criteria.valid" >
60
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
61
+            <foreach collection="criteria.criteria" item="criterion" >
62
+              <choose >
63
+                <when test="criterion.noValue" >
64
+                  and ${criterion.condition}
65
+                </when>
66
+                <when test="criterion.singleValue" >
67
+                  and ${criterion.condition} #{criterion.value}
68
+                </when>
69
+                <when test="criterion.betweenValue" >
70
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
71
+                </when>
72
+                <when test="criterion.listValue" >
73
+                  and ${criterion.condition}
74
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
75
+                    #{listItem}
76
+                  </foreach>
77
+                </when>
78
+              </choose>
79
+            </foreach>
80
+          </trim>
81
+        </if>
82
+      </foreach>
83
+    </where>
84
+  </sql>
85
+  <sql id="Base_Column_List" >
86
+    id, org_id, user_id, user_zh, user_name, user_role, user_address, dl_time, zx_time, 
87
+    func_id, func_name, btn_id, method_name, oper_result, parameter, rtn_param, describes, 
88
+    type, device_ip, system_identify, operation_time
89
+  </sql>
90
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.system.model.SystemLogExample" >
91
+    select
92
+    <if test="distinct" >
93
+      distinct
94
+    </if>
95
+    <include refid="Base_Column_List" />
96
+    from system_log
97
+    <if test="_parameter != null" >
98
+      <include refid="Example_Where_Clause" />
99
+    </if>
100
+    <if test="orderByClause != null" >
101
+      order by ${orderByClause}
102
+    </if>
103
+  </select>
104
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
105
+    select 
106
+    <include refid="Base_Column_List" />
107
+    from system_log
108
+    where id = #{id,jdbcType=VARCHAR}
109
+  </select>
110
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
111
+    delete from system_log
112
+    where id = #{id,jdbcType=VARCHAR}
113
+  </delete>
114
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.system.model.SystemLogExample" >
115
+    delete from system_log
116
+    <if test="_parameter != null" >
117
+      <include refid="Example_Where_Clause" />
118
+    </if>
119
+  </delete>
120
+  <insert id="insert" parameterType="com.chinaitop.depot.system.model.SystemLog" >
121
+    insert into system_log (id, org_id, user_id, 
122
+      user_zh, user_name, user_role, 
123
+      user_address, dl_time, zx_time, 
124
+      func_id, func_name, btn_id, 
125
+      method_name, oper_result, parameter, 
126
+      rtn_param, describes, type, 
127
+      device_ip, system_identify, operation_time
128
+      )
129
+    values (#{id,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, 
130
+      #{userZh,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{userRole,jdbcType=VARCHAR}, 
131
+      #{userAddress,jdbcType=VARCHAR}, #{dlTime,jdbcType=TIMESTAMP}, #{zxTime,jdbcType=TIMESTAMP}, 
132
+      #{funcId,jdbcType=INTEGER}, #{funcName,jdbcType=VARCHAR}, #{btnId,jdbcType=INTEGER}, 
133
+      #{methodName,jdbcType=VARCHAR}, #{operResult,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR}, 
134
+      #{rtnParam,jdbcType=VARCHAR}, #{describes,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
135
+      #{deviceIp,jdbcType=VARCHAR}, #{systemIdentify,jdbcType=VARCHAR}, #{operationTime,jdbcType=TIMESTAMP}
136
+      )
137
+  </insert>
138
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.system.model.SystemLog" >
139
+    insert into system_log
140
+    <trim prefix="(" suffix=")" suffixOverrides="," >
141
+      <if test="id != null" >
142
+        id,
143
+      </if>
144
+      <if test="orgId != null" >
145
+        org_id,
146
+      </if>
147
+      <if test="userId != null" >
148
+        user_id,
149
+      </if>
150
+      <if test="userZh != null" >
151
+        user_zh,
152
+      </if>
153
+      <if test="userName != null" >
154
+        user_name,
155
+      </if>
156
+      <if test="userRole != null" >
157
+        user_role,
158
+      </if>
159
+      <if test="userAddress != null" >
160
+        user_address,
161
+      </if>
162
+      <if test="dlTime != null" >
163
+        dl_time,
164
+      </if>
165
+      <if test="zxTime != null" >
166
+        zx_time,
167
+      </if>
168
+      <if test="funcId != null" >
169
+        func_id,
170
+      </if>
171
+      <if test="funcName != null" >
172
+        func_name,
173
+      </if>
174
+      <if test="btnId != null" >
175
+        btn_id,
176
+      </if>
177
+      <if test="methodName != null" >
178
+        method_name,
179
+      </if>
180
+      <if test="operResult != null" >
181
+        oper_result,
182
+      </if>
183
+      <if test="parameter != null" >
184
+        parameter,
185
+      </if>
186
+      <if test="rtnParam != null" >
187
+        rtn_param,
188
+      </if>
189
+      <if test="describes != null" >
190
+        describes,
191
+      </if>
192
+      <if test="type != null" >
193
+        type,
194
+      </if>
195
+      <if test="deviceIp != null" >
196
+        device_ip,
197
+      </if>
198
+      <if test="systemIdentify != null" >
199
+        system_identify,
200
+      </if>
201
+      <if test="operationTime != null" >
202
+        operation_time,
203
+      </if>
204
+    </trim>
205
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
206
+      <if test="id != null" >
207
+        #{id,jdbcType=VARCHAR},
208
+      </if>
209
+      <if test="orgId != null" >
210
+        #{orgId,jdbcType=INTEGER},
211
+      </if>
212
+      <if test="userId != null" >
213
+        #{userId,jdbcType=INTEGER},
214
+      </if>
215
+      <if test="userZh != null" >
216
+        #{userZh,jdbcType=VARCHAR},
217
+      </if>
218
+      <if test="userName != null" >
219
+        #{userName,jdbcType=VARCHAR},
220
+      </if>
221
+      <if test="userRole != null" >
222
+        #{userRole,jdbcType=VARCHAR},
223
+      </if>
224
+      <if test="userAddress != null" >
225
+        #{userAddress,jdbcType=VARCHAR},
226
+      </if>
227
+      <if test="dlTime != null" >
228
+        #{dlTime,jdbcType=TIMESTAMP},
229
+      </if>
230
+      <if test="zxTime != null" >
231
+        #{zxTime,jdbcType=TIMESTAMP},
232
+      </if>
233
+      <if test="funcId != null" >
234
+        #{funcId,jdbcType=INTEGER},
235
+      </if>
236
+      <if test="funcName != null" >
237
+        #{funcName,jdbcType=VARCHAR},
238
+      </if>
239
+      <if test="btnId != null" >
240
+        #{btnId,jdbcType=INTEGER},
241
+      </if>
242
+      <if test="methodName != null" >
243
+        #{methodName,jdbcType=VARCHAR},
244
+      </if>
245
+      <if test="operResult != null" >
246
+        #{operResult,jdbcType=VARCHAR},
247
+      </if>
248
+      <if test="parameter != null" >
249
+        #{parameter,jdbcType=VARCHAR},
250
+      </if>
251
+      <if test="rtnParam != null" >
252
+        #{rtnParam,jdbcType=VARCHAR},
253
+      </if>
254
+      <if test="describes != null" >
255
+        #{describes,jdbcType=VARCHAR},
256
+      </if>
257
+      <if test="type != null" >
258
+        #{type,jdbcType=VARCHAR},
259
+      </if>
260
+      <if test="deviceIp != null" >
261
+        #{deviceIp,jdbcType=VARCHAR},
262
+      </if>
263
+      <if test="systemIdentify != null" >
264
+        #{systemIdentify,jdbcType=VARCHAR},
265
+      </if>
266
+      <if test="operationTime != null" >
267
+        #{operationTime,jdbcType=TIMESTAMP},
268
+      </if>
269
+    </trim>
270
+  </insert>
271
+  <select id="countByExample" parameterType="com.chinaitop.depot.system.model.SystemLogExample" resultType="java.lang.Integer" >
272
+    select count(*) from system_log
273
+    <if test="_parameter != null" >
274
+      <include refid="Example_Where_Clause" />
275
+    </if>
276
+  </select>
277
+  <update id="updateByExampleSelective" parameterType="map" >
278
+    update system_log
279
+    <set >
280
+      <if test="record.id != null" >
281
+        id = #{record.id,jdbcType=VARCHAR},
282
+      </if>
283
+      <if test="record.orgId != null" >
284
+        org_id = #{record.orgId,jdbcType=INTEGER},
285
+      </if>
286
+      <if test="record.userId != null" >
287
+        user_id = #{record.userId,jdbcType=INTEGER},
288
+      </if>
289
+      <if test="record.userZh != null" >
290
+        user_zh = #{record.userZh,jdbcType=VARCHAR},
291
+      </if>
292
+      <if test="record.userName != null" >
293
+        user_name = #{record.userName,jdbcType=VARCHAR},
294
+      </if>
295
+      <if test="record.userRole != null" >
296
+        user_role = #{record.userRole,jdbcType=VARCHAR},
297
+      </if>
298
+      <if test="record.userAddress != null" >
299
+        user_address = #{record.userAddress,jdbcType=VARCHAR},
300
+      </if>
301
+      <if test="record.dlTime != null" >
302
+        dl_time = #{record.dlTime,jdbcType=TIMESTAMP},
303
+      </if>
304
+      <if test="record.zxTime != null" >
305
+        zx_time = #{record.zxTime,jdbcType=TIMESTAMP},
306
+      </if>
307
+      <if test="record.funcId != null" >
308
+        func_id = #{record.funcId,jdbcType=INTEGER},
309
+      </if>
310
+      <if test="record.funcName != null" >
311
+        func_name = #{record.funcName,jdbcType=VARCHAR},
312
+      </if>
313
+      <if test="record.btnId != null" >
314
+        btn_id = #{record.btnId,jdbcType=INTEGER},
315
+      </if>
316
+      <if test="record.methodName != null" >
317
+        method_name = #{record.methodName,jdbcType=VARCHAR},
318
+      </if>
319
+      <if test="record.operResult != null" >
320
+        oper_result = #{record.operResult,jdbcType=VARCHAR},
321
+      </if>
322
+      <if test="record.parameter != null" >
323
+        parameter = #{record.parameter,jdbcType=VARCHAR},
324
+      </if>
325
+      <if test="record.rtnParam != null" >
326
+        rtn_param = #{record.rtnParam,jdbcType=VARCHAR},
327
+      </if>
328
+      <if test="record.describes != null" >
329
+        describes = #{record.describes,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="record.type != null" >
332
+        type = #{record.type,jdbcType=VARCHAR},
333
+      </if>
334
+      <if test="record.deviceIp != null" >
335
+        device_ip = #{record.deviceIp,jdbcType=VARCHAR},
336
+      </if>
337
+      <if test="record.systemIdentify != null" >
338
+        system_identify = #{record.systemIdentify,jdbcType=VARCHAR},
339
+      </if>
340
+      <if test="record.operationTime != null" >
341
+        operation_time = #{record.operationTime,jdbcType=TIMESTAMP},
342
+      </if>
343
+    </set>
344
+    <if test="_parameter != null" >
345
+      <include refid="Update_By_Example_Where_Clause" />
346
+    </if>
347
+  </update>
348
+  <update id="updateByExample" parameterType="map" >
349
+    update system_log
350
+    set id = #{record.id,jdbcType=VARCHAR},
351
+      org_id = #{record.orgId,jdbcType=INTEGER},
352
+      user_id = #{record.userId,jdbcType=INTEGER},
353
+      user_zh = #{record.userZh,jdbcType=VARCHAR},
354
+      user_name = #{record.userName,jdbcType=VARCHAR},
355
+      user_role = #{record.userRole,jdbcType=VARCHAR},
356
+      user_address = #{record.userAddress,jdbcType=VARCHAR},
357
+      dl_time = #{record.dlTime,jdbcType=TIMESTAMP},
358
+      zx_time = #{record.zxTime,jdbcType=TIMESTAMP},
359
+      func_id = #{record.funcId,jdbcType=INTEGER},
360
+      func_name = #{record.funcName,jdbcType=VARCHAR},
361
+      btn_id = #{record.btnId,jdbcType=INTEGER},
362
+      method_name = #{record.methodName,jdbcType=VARCHAR},
363
+      oper_result = #{record.operResult,jdbcType=VARCHAR},
364
+      parameter = #{record.parameter,jdbcType=VARCHAR},
365
+      rtn_param = #{record.rtnParam,jdbcType=VARCHAR},
366
+      describes = #{record.describes,jdbcType=VARCHAR},
367
+      type = #{record.type,jdbcType=VARCHAR},
368
+      device_ip = #{record.deviceIp,jdbcType=VARCHAR},
369
+      system_identify = #{record.systemIdentify,jdbcType=VARCHAR},
370
+      operation_time = #{record.operationTime,jdbcType=TIMESTAMP}
371
+    <if test="_parameter != null" >
372
+      <include refid="Update_By_Example_Where_Clause" />
373
+    </if>
374
+  </update>
375
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.system.model.SystemLog" >
376
+    update system_log
377
+    <set >
378
+      <if test="orgId != null" >
379
+        org_id = #{orgId,jdbcType=INTEGER},
380
+      </if>
381
+      <if test="userId != null" >
382
+        user_id = #{userId,jdbcType=INTEGER},
383
+      </if>
384
+      <if test="userZh != null" >
385
+        user_zh = #{userZh,jdbcType=VARCHAR},
386
+      </if>
387
+      <if test="userName != null" >
388
+        user_name = #{userName,jdbcType=VARCHAR},
389
+      </if>
390
+      <if test="userRole != null" >
391
+        user_role = #{userRole,jdbcType=VARCHAR},
392
+      </if>
393
+      <if test="userAddress != null" >
394
+        user_address = #{userAddress,jdbcType=VARCHAR},
395
+      </if>
396
+      <if test="dlTime != null" >
397
+        dl_time = #{dlTime,jdbcType=TIMESTAMP},
398
+      </if>
399
+      <if test="zxTime != null" >
400
+        zx_time = #{zxTime,jdbcType=TIMESTAMP},
401
+      </if>
402
+      <if test="funcId != null" >
403
+        func_id = #{funcId,jdbcType=INTEGER},
404
+      </if>
405
+      <if test="funcName != null" >
406
+        func_name = #{funcName,jdbcType=VARCHAR},
407
+      </if>
408
+      <if test="btnId != null" >
409
+        btn_id = #{btnId,jdbcType=INTEGER},
410
+      </if>
411
+      <if test="methodName != null" >
412
+        method_name = #{methodName,jdbcType=VARCHAR},
413
+      </if>
414
+      <if test="operResult != null" >
415
+        oper_result = #{operResult,jdbcType=VARCHAR},
416
+      </if>
417
+      <if test="parameter != null" >
418
+        parameter = #{parameter,jdbcType=VARCHAR},
419
+      </if>
420
+      <if test="rtnParam != null" >
421
+        rtn_param = #{rtnParam,jdbcType=VARCHAR},
422
+      </if>
423
+      <if test="describes != null" >
424
+        describes = #{describes,jdbcType=VARCHAR},
425
+      </if>
426
+      <if test="type != null" >
427
+        type = #{type,jdbcType=VARCHAR},
428
+      </if>
429
+      <if test="deviceIp != null" >
430
+        device_ip = #{deviceIp,jdbcType=VARCHAR},
431
+      </if>
432
+      <if test="systemIdentify != null" >
433
+        system_identify = #{systemIdentify,jdbcType=VARCHAR},
434
+      </if>
435
+      <if test="operationTime != null" >
436
+        operation_time = #{operationTime,jdbcType=TIMESTAMP},
437
+      </if>
438
+    </set>
439
+    where id = #{id,jdbcType=VARCHAR}
440
+  </update>
441
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.system.model.SystemLog" >
442
+    update system_log
443
+    set org_id = #{orgId,jdbcType=INTEGER},
444
+      user_id = #{userId,jdbcType=INTEGER},
445
+      user_zh = #{userZh,jdbcType=VARCHAR},
446
+      user_name = #{userName,jdbcType=VARCHAR},
447
+      user_role = #{userRole,jdbcType=VARCHAR},
448
+      user_address = #{userAddress,jdbcType=VARCHAR},
449
+      dl_time = #{dlTime,jdbcType=TIMESTAMP},
450
+      zx_time = #{zxTime,jdbcType=TIMESTAMP},
451
+      func_id = #{funcId,jdbcType=INTEGER},
452
+      func_name = #{funcName,jdbcType=VARCHAR},
453
+      btn_id = #{btnId,jdbcType=INTEGER},
454
+      method_name = #{methodName,jdbcType=VARCHAR},
455
+      oper_result = #{operResult,jdbcType=VARCHAR},
456
+      parameter = #{parameter,jdbcType=VARCHAR},
457
+      rtn_param = #{rtnParam,jdbcType=VARCHAR},
458
+      describes = #{describes,jdbcType=VARCHAR},
459
+      type = #{type,jdbcType=VARCHAR},
460
+      device_ip = #{deviceIp,jdbcType=VARCHAR},
461
+      system_identify = #{systemIdentify,jdbcType=VARCHAR},
462
+      operation_time = #{operationTime,jdbcType=TIMESTAMP}
463
+    where id = #{id,jdbcType=VARCHAR}
464
+  </update>
465
+</mapper>

+ 48 - 0
src/main/java/com/chinaitop/depot/system/model/RoleButton.java

@@ -13,6 +13,13 @@ public class RoleButton implements Serializable{
13 13
     private Integer roleId;
14 14
 
15 15
     private Integer btnId;
16
+    
17
+    //特殊处理添加
18
+    private Integer funcId;
19
+    private String btnName;
20
+    private String btnUrl;
21
+    private String remark;
22
+    private String funcName;
16 23
 
17 24
     /**
18 25
      * 编号
@@ -61,4 +68,45 @@ public class RoleButton implements Serializable{
61 68
     public void setBtnId(Integer btnId) {
62 69
         this.btnId = btnId;
63 70
     }
71
+
72
+	public Integer getFuncId() {
73
+		return funcId;
74
+	}
75
+
76
+	public void setFuncId(Integer funcId) {
77
+		this.funcId = funcId;
78
+	}
79
+
80
+	public String getBtnName() {
81
+		return btnName;
82
+	}
83
+
84
+	public void setBtnName(String btnName) {
85
+		this.btnName = btnName;
86
+	}
87
+
88
+	public String getBtnUrl() {
89
+		return btnUrl;
90
+	}
91
+
92
+	public void setBtnUrl(String btnUrl) {
93
+		this.btnUrl = btnUrl;
94
+	}
95
+
96
+	public String getRemark() {
97
+		return remark;
98
+	}
99
+
100
+	public void setRemark(String remark) {
101
+		this.remark = remark;
102
+	}
103
+
104
+	public String getFuncName() {
105
+		return funcName;
106
+	}
107
+
108
+	public void setFuncName(String funcName) {
109
+		this.funcName = funcName;
110
+	}
111
+    
64 112
 }

+ 383 - 0
src/main/java/com/chinaitop/depot/system/model/SystemLog.java

@@ -0,0 +1,383 @@
1
+package com.chinaitop.depot.system.model;
2
+
3
+import java.util.Date;
4
+
5
+public class SystemLog {
6
+    private String id;
7
+
8
+    private Integer orgId;
9
+
10
+    private Integer userId;
11
+
12
+    private String userZh;
13
+
14
+    private String userName;
15
+
16
+    private String userRole;
17
+
18
+    private String userAddress;
19
+
20
+    private Date dlTime;
21
+
22
+    private Date zxTime;
23
+
24
+    private Integer funcId;
25
+
26
+    private String funcName;
27
+
28
+    private Integer btnId;
29
+
30
+    private String methodName;
31
+
32
+    private String operResult;
33
+
34
+    private String parameter;
35
+
36
+    private String rtnParam;
37
+
38
+    private String describes;
39
+
40
+    private String type;
41
+
42
+    private String deviceIp;
43
+
44
+    private String systemIdentify;
45
+
46
+    private Date operationTime;
47
+
48
+    /**
49
+     * 主键
50
+     * @return id 主键
51
+     */
52
+    public String getId() {
53
+        return id;
54
+    }
55
+
56
+    /**
57
+     * 主键
58
+     * @param id 主键
59
+     */
60
+    public void setId(String id) {
61
+        this.id = id == null ? null : id.trim();
62
+    }
63
+
64
+    /**
65
+     * 机构id
66
+     * @return org_id 机构id
67
+     */
68
+    public Integer getOrgId() {
69
+        return orgId;
70
+    }
71
+
72
+    /**
73
+     * 机构id
74
+     * @param orgId 机构id
75
+     */
76
+    public void setOrgId(Integer orgId) {
77
+        this.orgId = orgId;
78
+    }
79
+
80
+    /**
81
+     * 用户id
82
+     * @return user_id 用户id
83
+     */
84
+    public Integer getUserId() {
85
+        return userId;
86
+    }
87
+
88
+    /**
89
+     * 用户id
90
+     * @param userId 用户id
91
+     */
92
+    public void setUserId(Integer userId) {
93
+        this.userId = userId;
94
+    }
95
+
96
+    /**
97
+     * 用户账号
98
+     * @return user_zh 用户账号
99
+     */
100
+    public String getUserZh() {
101
+        return userZh;
102
+    }
103
+
104
+    /**
105
+     * 用户账号
106
+     * @param userZh 用户账号
107
+     */
108
+    public void setUserZh(String userZh) {
109
+        this.userZh = userZh == null ? null : userZh.trim();
110
+    }
111
+
112
+    /**
113
+     * 用户名称
114
+     * @return user_name 用户名称
115
+     */
116
+    public String getUserName() {
117
+        return userName;
118
+    }
119
+
120
+    /**
121
+     * 用户名称
122
+     * @param userName 用户名称
123
+     */
124
+    public void setUserName(String userName) {
125
+        this.userName = userName == null ? null : userName.trim();
126
+    }
127
+
128
+    /**
129
+     * 用户角色
130
+     * @return user_role 用户角色
131
+     */
132
+    public String getUserRole() {
133
+        return userRole;
134
+    }
135
+
136
+    /**
137
+     * 用户角色
138
+     * @param userRole 用户角色
139
+     */
140
+    public void setUserRole(String userRole) {
141
+        this.userRole = userRole == null ? null : userRole.trim();
142
+    }
143
+
144
+    /**
145
+     * 用户所属机构行政区划
146
+     * @return user_address 用户所属机构行政区划
147
+     */
148
+    public String getUserAddress() {
149
+        return userAddress;
150
+    }
151
+
152
+    /**
153
+     * 用户所属机构行政区划
154
+     * @param userAddress 用户所属机构行政区划
155
+     */
156
+    public void setUserAddress(String userAddress) {
157
+        this.userAddress = userAddress == null ? null : userAddress.trim();
158
+    }
159
+
160
+    /**
161
+     * 登录时间
162
+     * @return dl_time 登录时间
163
+     */
164
+    public Date getDlTime() {
165
+        return dlTime;
166
+    }
167
+
168
+    /**
169
+     * 登录时间
170
+     * @param dlTime 登录时间
171
+     */
172
+    public void setDlTime(Date dlTime) {
173
+        this.dlTime = dlTime;
174
+    }
175
+
176
+    /**
177
+     * 注销时间
178
+     * @return zx_time 注销时间
179
+     */
180
+    public Date getZxTime() {
181
+        return zxTime;
182
+    }
183
+
184
+    /**
185
+     * 注销时间
186
+     * @param zxTime 注销时间
187
+     */
188
+    public void setZxTime(Date zxTime) {
189
+        this.zxTime = zxTime;
190
+    }
191
+
192
+    /**
193
+     * 功能id
194
+     * @return func_id 功能id
195
+     */
196
+    public Integer getFuncId() {
197
+        return funcId;
198
+    }
199
+
200
+    /**
201
+     * 功能id
202
+     * @param funcId 功能id
203
+     */
204
+    public void setFuncId(Integer funcId) {
205
+        this.funcId = funcId;
206
+    }
207
+
208
+    /**
209
+     * 菜单名称
210
+     * @return func_name 菜单名称
211
+     */
212
+    public String getFuncName() {
213
+        return funcName;
214
+    }
215
+
216
+    /**
217
+     * 菜单名称
218
+     * @param funcName 菜单名称
219
+     */
220
+    public void setFuncName(String funcName) {
221
+        this.funcName = funcName == null ? null : funcName.trim();
222
+    }
223
+
224
+    /**
225
+     * 按钮id
226
+     * @return btn_id 按钮id
227
+     */
228
+    public Integer getBtnId() {
229
+        return btnId;
230
+    }
231
+
232
+    /**
233
+     * 按钮id
234
+     * @param btnId 按钮id
235
+     */
236
+    public void setBtnId(Integer btnId) {
237
+        this.btnId = btnId;
238
+    }
239
+
240
+    /**
241
+     * 方法名
242
+     * @return method_name 方法名
243
+     */
244
+    public String getMethodName() {
245
+        return methodName;
246
+    }
247
+
248
+    /**
249
+     * 方法名
250
+     * @param methodName 方法名
251
+     */
252
+    public void setMethodName(String methodName) {
253
+        this.methodName = methodName == null ? null : methodName.trim();
254
+    }
255
+
256
+    /**
257
+     * 操作结果
258
+     * @return oper_result 操作结果
259
+     */
260
+    public String getOperResult() {
261
+        return operResult;
262
+    }
263
+
264
+    /**
265
+     * 操作结果
266
+     * @param operResult 操作结果
267
+     */
268
+    public void setOperResult(String operResult) {
269
+        this.operResult = operResult == null ? null : operResult.trim();
270
+    }
271
+
272
+    /**
273
+     * 请求参数
274
+     * @return parameter 请求参数
275
+     */
276
+    public String getParameter() {
277
+        return parameter;
278
+    }
279
+
280
+    /**
281
+     * 请求参数
282
+     * @param parameter 请求参数
283
+     */
284
+    public void setParameter(String parameter) {
285
+        this.parameter = parameter == null ? null : parameter.trim();
286
+    }
287
+
288
+    /**
289
+     * 返回参数
290
+     * @return rtn_param 返回参数
291
+     */
292
+    public String getRtnParam() {
293
+        return rtnParam;
294
+    }
295
+
296
+    /**
297
+     * 返回参数
298
+     * @param rtnParam 返回参数
299
+     */
300
+    public void setRtnParam(String rtnParam) {
301
+        this.rtnParam = rtnParam == null ? null : rtnParam.trim();
302
+    }
303
+
304
+    /**
305
+     * 日志描述
306
+     * @return describes 日志描述
307
+     */
308
+    public String getDescribes() {
309
+        return describes;
310
+    }
311
+
312
+    /**
313
+     * 日志描述
314
+     * @param describes 日志描述
315
+     */
316
+    public void setDescribes(String describes) {
317
+        this.describes = describes == null ? null : describes.trim();
318
+    }
319
+
320
+    /**
321
+     * 日志类型:1 登录 2 访问 3 操作
322
+     * @return type 日志类型:1 登录 2 访问 3 操作
323
+     */
324
+    public String getType() {
325
+        return type;
326
+    }
327
+
328
+    /**
329
+     * 日志类型:1 登录 2 访问 3 操作
330
+     * @param type 日志类型:1 登录 2 访问 3 操作
331
+     */
332
+    public void setType(String type) {
333
+        this.type = type == null ? null : type.trim();
334
+    }
335
+
336
+    /**
337
+     * 设备ip
338
+     * @return device_ip 设备ip
339
+     */
340
+    public String getDeviceIp() {
341
+        return deviceIp;
342
+    }
343
+
344
+    /**
345
+     * 设备ip
346
+     * @param deviceIp 设备ip
347
+     */
348
+    public void setDeviceIp(String deviceIp) {
349
+        this.deviceIp = deviceIp == null ? null : deviceIp.trim();
350
+    }
351
+
352
+    /**
353
+     * 系统标识:库级系统
354
+     * @return system_identify 系统标识:库级系统
355
+     */
356
+    public String getSystemIdentify() {
357
+        return systemIdentify;
358
+    }
359
+
360
+    /**
361
+     * 系统标识:库级系统
362
+     * @param systemIdentify 系统标识:库级系统
363
+     */
364
+    public void setSystemIdentify(String systemIdentify) {
365
+        this.systemIdentify = systemIdentify == null ? null : systemIdentify.trim();
366
+    }
367
+
368
+    /**
369
+     * 操作时间
370
+     * @return operation_time 操作时间
371
+     */
372
+    public Date getOperationTime() {
373
+        return operationTime;
374
+    }
375
+
376
+    /**
377
+     * 操作时间
378
+     * @param operationTime 操作时间
379
+     */
380
+    public void setOperationTime(Date operationTime) {
381
+        this.operationTime = operationTime;
382
+    }
383
+}

File diff suppressed because it is too large
+ 1619 - 0
src/main/java/com/chinaitop/depot/system/model/SystemLogExample.java


+ 21 - 3
src/main/java/com/chinaitop/depot/system/service/impl/RoleButtonServiceImpl.java

@@ -4,11 +4,18 @@ import com.chinaitop.depot.system.mapper.RoleButtonMapper;
4 4
 import com.chinaitop.depot.system.mapper.UserRoleMapper;
5 5
 import com.chinaitop.depot.system.model.*;
6 6
 import com.chinaitop.depot.system.service.RoleButtonService;
7
+import com.chinaitop.depot.utils.RedisUtil;
8
+import com.google.gson.Gson;
9
+
10
+import org.json.JSONArray;
11
+import org.springframework.beans.factory.annotation.Autowired;
7 12
 import org.springframework.stereotype.Service;
8 13
 
9 14
 import javax.annotation.Resource;
10 15
 import java.util.ArrayList;
16
+import java.util.HashMap;
11 17
 import java.util.List;
18
+import java.util.Map;
12 19
 
13 20
 @Service
14 21
 public class RoleButtonServiceImpl implements RoleButtonService {
@@ -19,6 +26,9 @@ public class RoleButtonServiceImpl implements RoleButtonService {
19 26
 	@Resource
20 27
 	private UserRoleMapper userRoleMapper;
21 28
 
29
+	@Autowired
30
+	private RedisUtil redisUtil;
31
+
22 32
 	@Override
23 33
 	public List<RoleButton> queryByExample(RoleButtonExample example) {
24 34
 		// TODO Auto-generated method stub
@@ -72,9 +82,17 @@ public class RoleButtonServiceImpl implements RoleButtonService {
72 82
 			if(urList!=null){
73 83
 				urList.forEach(ur -> roleIds.add(ur.getRoleId()));
74 84
 			}
75
-			RoleButtonExample rbExample = new RoleButtonExample();
76
-			rbExample.createCriteria().andRoleIdIn(roleIds);
77
-			List<RoleButton> rbList = roleButtonMapper.selectByExample(rbExample );
85
+//			RoleButtonExample rbExample = new RoleButtonExample();
86
+//			rbExample.createCriteria().andRoleIdIn(roleIds);
87
+			Map<String, Object> param = new HashMap<String, Object>();
88
+			Gson gson=new Gson();
89
+			String jsonids = gson.toJson(roleIds);
90
+			jsonids = jsonids.replace("[", "(");
91
+			jsonids = jsonids.replace("]", ")");
92
+			param.put("roleIds", jsonids);
93
+			List<RoleButton> rbList = roleButtonMapper.selectByExampleNew(param);
94
+			String json = gson.toJson(rbList);
95
+			redisUtil.set("permissionList", json);
78 96
 			return rbList;
79 97
 	}
80 98
 

+ 10 - 0
src/main/java/com/chinaitop/depot/system/service/impl/RoleFuncServiceImpl.java

@@ -5,6 +5,10 @@ import com.chinaitop.depot.system.mapper.RoleFuncMapper;
5 5
 import com.chinaitop.depot.system.mapper.UserRoleMapper;
6 6
 import com.chinaitop.depot.system.model.*;
7 7
 import com.chinaitop.depot.system.service.RoleFuncService;
8
+import com.chinaitop.depot.utils.RedisUtil;
9
+import com.google.gson.Gson;
10
+
11
+import org.springframework.beans.factory.annotation.Autowired;
8 12
 import org.springframework.stereotype.Service;
9 13
 
10 14
 import javax.annotation.Resource;
@@ -22,6 +26,9 @@ public class RoleFuncServiceImpl implements RoleFuncService {
22 26
 	
23 27
 	@Resource
24 28
 	private FuncInfoMapper funcInfoMapper;
29
+	
30
+	@Autowired
31
+	private RedisUtil redisUtil;
25 32
 
26 33
 	@Override
27 34
 	public List<RoleFunc> queryByRoleId(Integer roleId) {
@@ -85,6 +92,9 @@ public class RoleFuncServiceImpl implements RoleFuncService {
85 92
 				funclist = funcInfoMapper.selectByExample(funcInfoExample);
86 93
 			}
87 94
 		}
95
+		Gson gson=new Gson();
96
+		String json = gson.toJson(funclist);
97
+		redisUtil.set("hasFuncList", json);
88 98
 		return funclist;
89 99
 	}
90 100
 

+ 40 - 0
src/main/java/com/chinaitop/depot/system/service/impl/UserInfoServiceImpl.java

@@ -1,8 +1,11 @@
1 1
 package com.chinaitop.depot.system.service.impl;
2 2
 
3
+import com.chinaitop.depot.system.mapper.RoleInfoMapper;
3 4
 import com.chinaitop.depot.system.mapper.UserBusinessMapper;
4 5
 import com.chinaitop.depot.system.mapper.UserInfoMapper;
5 6
 import com.chinaitop.depot.system.mapper.UserRoleMapper;
7
+import com.chinaitop.depot.system.model.RoleInfo;
8
+import com.chinaitop.depot.system.model.RoleInfoExample;
6 9
 import com.chinaitop.depot.system.model.UserInfo;
7 10
 import com.chinaitop.depot.system.model.UserInfoExample;
8 11
 import com.chinaitop.depot.system.model.UserInfoExample.Criteria;
@@ -31,6 +34,9 @@ public class UserInfoServiceImpl implements UserInfoService {
31 34
 	
32 35
 	@Resource
33 36
 	private UserBusinessMapper userBusinessMapper;
37
+	
38
+	@Resource
39
+	private RoleInfoMapper roleInfoMapper;
34 40
 
35 41
 	@Override
36 42
 	public UserInfo valid(String UserInfoName, String password) {
@@ -49,11 +55,45 @@ public class UserInfoServiceImpl implements UserInfoService {
49 55
 				roleIds.add(String.valueOf(userRole.getRoleId()));
50 56
 			}
51 57
 			userInfo.setRoleIds(roleIds);
58
+			//获取所属角色
59
+			List<Integer> new_roleIds = new ArrayList<Integer>();
60
+			for (UserRole userRole : urList) {
61
+				new_roleIds.add(userRole.getRoleId());
62
+			}
63
+			String roleNames = "";
64
+			if (new_roleIds.size() > 0) {
65
+				roleNames = getRoleNames(new_roleIds);
66
+			}
67
+			userInfo.setRoleNames(roleNames);
52 68
 			return userInfo;
53 69
 		}
54 70
 		return null;
55 71
 	}
56 72
 
73
+	/**
74
+	 * 获取角色名称
75
+	 * 
76
+	 * @param new_roleIds 角色ID集合
77
+	 * @return
78
+	 */
79
+	private String getRoleNames(List<Integer> new_roleIds) {
80
+		String roleNames = "";
81
+		//获取所属角色
82
+		RoleInfoExample roleinfoExample = new RoleInfoExample();
83
+		RoleInfoExample.Criteria roleinfo_criteria = roleinfoExample.createCriteria();
84
+		roleinfo_criteria.andRoleIdIn(new_roleIds);
85
+		List<RoleInfo> roleinfo_list = roleInfoMapper.selectByExample(roleinfoExample);
86
+		//组装成string返回
87
+		StringBuffer sbf = new StringBuffer();
88
+		for (RoleInfo roleinfo : roleinfo_list) {
89
+			sbf.append(roleinfo.getRoleName()).append(",");
90
+		}
91
+		if (sbf.toString().length() > 0) {
92
+			roleNames = sbf.toString().substring(0, sbf.toString().length() - 1);
93
+		}
94
+		return roleNames;
95
+	}
96
+
57 97
 	@Override
58 98
 	public List<UserInfo> queryByExample(UserInfoExample example) {
59 99
 		// TODO Auto-generated method stub

+ 39 - 0
src/main/java/com/chinaitop/depot/utils/GeneratorSqlmap.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.utils;
2
+
3
+import org.mybatis.generator.api.MyBatisGenerator;
4
+import org.mybatis.generator.config.Configuration;
5
+import org.mybatis.generator.config.xml.ConfigurationParser;
6
+import org.mybatis.generator.internal.DefaultShellCallback;
7
+
8
+import java.io.File;
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+
12
+public class GeneratorSqlmap {
13
+
14
+	public void generator() throws Exception{
15
+
16
+		List<String> warnings = new ArrayList<String>();
17
+		boolean overwrite = true;
18
+		//指定 逆向工程配置文件(写自己电脑的路径)F:\LsProject\depot-basic\src\main\resources
19
+		File configFile = new File("D:\\git_10.10.1.25\\depot-system-yunnan\\src\\main\\resources\\generatorConfig.xml");
20
+		ConfigurationParser cp = new ConfigurationParser(warnings);
21
+		Configuration config = cp.parseConfiguration(configFile);
22
+		DefaultShellCallback callback = new DefaultShellCallback(overwrite);
23
+		MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,
24
+				callback, warnings);
25
+		myBatisGenerator.generate(null);
26
+	} 
27
+	public static void main(String[] args) throws Exception {
28
+		try {
29
+			GeneratorSqlmap generatorSqlmap = new GeneratorSqlmap();
30
+			generatorSqlmap.generator();
31
+			System.out.println("生成成功");
32
+		} catch (Exception e) {
33
+			e.printStackTrace();
34
+			System.out.println("生成失败");
35
+		}
36
+		
37
+	}
38
+
39
+}

+ 242 - 0
src/main/java/com/chinaitop/depot/utils/MyCommentGenerator.java

@@ -0,0 +1,242 @@
1
+package com.chinaitop.depot.utils;
2
+import java.text.SimpleDateFormat;
3
+import java.util.Date;
4
+import java.util.Properties;
5
+
6
+import static org.mybatis.generator.internal.util.StringUtility.isTrue;
7
+import org.mybatis.generator.api.CommentGenerator;
8
+import org.mybatis.generator.api.IntrospectedColumn;
9
+import org.mybatis.generator.api.IntrospectedTable;
10
+import org.mybatis.generator.api.dom.java.CompilationUnit;
11
+import org.mybatis.generator.api.dom.java.Field;
12
+import org.mybatis.generator.api.dom.java.InnerClass;
13
+import org.mybatis.generator.api.dom.java.InnerEnum;
14
+import org.mybatis.generator.api.dom.java.JavaElement;
15
+import org.mybatis.generator.api.dom.java.Method;
16
+import org.mybatis.generator.api.dom.java.Parameter;
17
+import org.mybatis.generator.api.dom.xml.XmlElement;
18
+import org.mybatis.generator.config.MergeConstants;
19
+import org.mybatis.generator.config.PropertyRegistry;
20
+
21
+public class MyCommentGenerator implements CommentGenerator {
22
+
23
+	private Properties properties;
24
+	private Properties systemPro;
25
+	private boolean suppressDate;
26
+	private boolean suppressAllComments;
27
+	private String currentDateStr;
28
+
29
+	public MyCommentGenerator() {
30
+	    super();
31
+	    properties = new Properties();
32
+	    systemPro = System.getProperties();
33
+	    suppressDate = false;
34
+	    suppressAllComments = false;
35
+	    currentDateStr = (new SimpleDateFormat("yyyy-MM-dd")).format(new Date());
36
+	}
37
+
38
+	
39
+	@Override
40
+	public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable) {
41
+		if (suppressAllComments) {
42
+	        return;
43
+	    }
44
+	    StringBuilder sb = new StringBuilder();
45
+	    innerClass.addJavaDocLine("/**");
46
+	    sb.append(" * ");
47
+	    sb.append(introspectedTable.getFullyQualifiedTable());
48
+	    sb.append(" ");
49
+	    sb.append(getDateString());
50
+	    innerClass.addJavaDocLine(sb.toString());
51
+	    innerClass.addJavaDocLine(" */");
52
+
53
+	}
54
+
55
+	@Override
56
+	public void addClassComment(InnerClass innerClass, IntrospectedTable introspectedTable, boolean arg2) {
57
+		if (suppressAllComments) {
58
+	        return;
59
+	    }
60
+
61
+	    StringBuilder sb = new StringBuilder();
62
+
63
+	    innerClass.addJavaDocLine("/**");
64
+	    sb.append(" * ");
65
+	    sb.append(introspectedTable.getFullyQualifiedTable());
66
+	    innerClass.addJavaDocLine(sb.toString());
67
+
68
+	    sb.setLength(0);
69
+	    sb.append(" * @author ");
70
+	    sb.append(systemPro.getProperty("user.name"));
71
+	    sb.append(" ");
72
+	    sb.append(currentDateStr);
73
+
74
+	    //      addJavadocTag(innerClass, markAsDoNotDelete);
75
+
76
+	    innerClass.addJavaDocLine(" */");
77
+
78
+	}
79
+
80
+	@Override
81
+	public void addComment(XmlElement arg0) {
82
+		return;
83
+	}
84
+
85
+	@Override
86
+	public void addConfigurationProperties(Properties properties) {
87
+		this.properties.putAll(properties);
88
+
89
+	    suppressDate = isTrue(properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_DATE));
90
+
91
+	    suppressAllComments = isTrue(properties.getProperty(PropertyRegistry.COMMENT_GENERATOR_SUPPRESS_ALL_COMMENTS));
92
+
93
+	}
94
+	
95
+	/**
96
+	 * This method adds the custom javadoc tag for. You may do nothing if you do
97
+	 * not wish to include the Javadoc tag - however, if you do not include the
98
+	 * Javadoc tag then the Java merge capability of the eclipse plugin will
99
+	 * break.
100
+	 * 
101
+	 * @param javaElement
102
+	 *            the java element
103
+	 */
104
+	protected void addJavadocTag(JavaElement javaElement, boolean markAsDoNotDelete) {
105
+	    javaElement.addJavaDocLine(" *");
106
+	    StringBuilder sb = new StringBuilder();
107
+	    sb.append(" * ");
108
+	    sb.append(MergeConstants.NEW_ELEMENT_TAG);
109
+	    if (markAsDoNotDelete) {
110
+	        sb.append(" do_not_delete_during_merge");
111
+	    }
112
+	    String s = getDateString();
113
+	    if (s != null) {
114
+	        sb.append(' ');
115
+	        sb.append(s);
116
+	    }
117
+	    javaElement.addJavaDocLine(sb.toString());
118
+	}
119
+	
120
+	protected String getDateString() {
121
+	    String result = null;
122
+	    if (!suppressDate) {
123
+	        result = currentDateStr;
124
+	    }
125
+	    return result;
126
+	}
127
+
128
+
129
+	@Override
130
+	public void addEnumComment(InnerEnum innerEnum, IntrospectedTable introspectedTable) {
131
+		if (suppressAllComments) {
132
+	        return;
133
+	    }
134
+
135
+	    StringBuilder sb = new StringBuilder();
136
+
137
+	    innerEnum.addJavaDocLine("/**");
138
+	    //      addJavadocTag(innerEnum, false);
139
+	    sb.append(" * ");
140
+	    sb.append(introspectedTable.getFullyQualifiedTable());
141
+	    innerEnum.addJavaDocLine(sb.toString());
142
+	    innerEnum.addJavaDocLine(" */");
143
+
144
+	}
145
+
146
+	@Override
147
+	public void addFieldComment(Field field, IntrospectedTable introspectedTable) {
148
+		if (suppressAllComments) {
149
+	        return;
150
+	    }
151
+
152
+	    StringBuilder sb = new StringBuilder();
153
+
154
+	    field.addJavaDocLine("/**");
155
+	    sb.append(" * ");
156
+	    sb.append(introspectedTable.getFullyQualifiedTable());
157
+	    field.addJavaDocLine(sb.toString());
158
+	    field.addJavaDocLine(" */");
159
+
160
+	}
161
+
162
+	@Override
163
+	public void addFieldComment(Field arg0, IntrospectedTable arg1, IntrospectedColumn arg2) {
164
+		// TODO Auto-generated method stub
165
+
166
+	}
167
+
168
+	@Override
169
+	public void addGeneralMethodComment(Method arg0, IntrospectedTable arg1) {
170
+		if (suppressAllComments) {
171
+	        return;
172
+	    }
173
+	    //      method.addJavaDocLine("/**");
174
+	    //      addJavadocTag(method, false);
175
+	    //      method.addJavaDocLine(" */");
176
+
177
+	}
178
+
179
+	@Override
180
+	public void addGetterComment(Method method, IntrospectedTable arg1, IntrospectedColumn introspectedColumn) {
181
+		if (suppressAllComments) {
182
+	        return;
183
+	    }
184
+
185
+	    method.addJavaDocLine("/**");
186
+
187
+	    StringBuilder sb = new StringBuilder();
188
+	    sb.append(" * ");
189
+	    sb.append(introspectedColumn.getRemarks());
190
+	    method.addJavaDocLine(sb.toString());
191
+
192
+	    sb.setLength(0);
193
+	    sb.append(" * @return ");
194
+	    sb.append(introspectedColumn.getActualColumnName());
195
+	    sb.append(" ");
196
+	    sb.append(introspectedColumn.getRemarks());
197
+	    method.addJavaDocLine(sb.toString());
198
+
199
+	    //      addJavadocTag(method, false);
200
+
201
+	    method.addJavaDocLine(" */");
202
+
203
+	}
204
+
205
+	@Override
206
+	public void addJavaFileComment(CompilationUnit arg0) {
207
+		return;
208
+	}
209
+
210
+	@Override
211
+	public void addRootComment(XmlElement arg0) {
212
+		return;
213
+	}
214
+
215
+	@Override
216
+	public void addSetterComment(Method method, IntrospectedTable arg1, IntrospectedColumn introspectedColumn) {
217
+		if (suppressAllComments) {
218
+	        return;
219
+	    }
220
+
221
+
222
+	    method.addJavaDocLine("/**");
223
+	    StringBuilder sb = new StringBuilder();
224
+	    sb.append(" * ");
225
+	    sb.append(introspectedColumn.getRemarks());
226
+	    method.addJavaDocLine(sb.toString());
227
+
228
+	    Parameter parm = method.getParameters().get(0);
229
+	    sb.setLength(0);
230
+	    sb.append(" * @param ");
231
+	    sb.append(parm.getName());
232
+	    sb.append(" ");
233
+	    sb.append(introspectedColumn.getRemarks());
234
+	    method.addJavaDocLine(sb.toString());
235
+
236
+	    //      addJavadocTag(method, false);
237
+
238
+	    method.addJavaDocLine(" */");
239
+
240
+	}
241
+
242
+}

+ 56 - 0
src/main/resources/generatorConfig.xml

@@ -0,0 +1,56 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE generatorConfiguration
3
+  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
4
+  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5
+
6
+<generatorConfiguration>
7
+	<context id="testTables" targetRuntime="MyBatis3">
8
+		<!-- 生成注释时,必须加type="MyCommentGenerator" -->
9
+		<commentGenerator type="com.chinaitop.depot.utils.MyCommentGenerator">
10
+			<!-- 是否去除自动生成的注释 true:是 : false:否 -->
11
+			<property name="suppressAllComments" value="false" />
12
+		</commentGenerator>
13
+		
14
+		<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
15
+		<jdbcConnection 
16
+			driverClass="com.mysql.jdbc.Driver"
17
+			connectionURL="jdbc:mysql://localhost:3306/depot_yunnan" 
18
+			userId="root"
19
+			password="123456">
20
+		</jdbcConnection>
21
+		
22
+		<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和 
23
+			NUMERIC 类型解析为java.math.BigDecimal -->
24
+		<javaTypeResolver>
25
+			<property name="forceBigDecimals" value="false" />
26
+		</javaTypeResolver>
27
+
28
+		<!-- targetProject:生成PO类的位置 -->
29
+		<javaModelGenerator targetPackage="com.chinaitop.depot.system.model"
30
+			targetProject=".\src\main\java">
31
+			<!-- enableSubPackages:是否让schema作为包的后缀 -->
32
+			<property name="enableSubPackages" value="false" />
33
+			<!-- 从数据库返回的值被清理前后的空格 -->
34
+			<property name="trimStrings" value="true" />
35
+		</javaModelGenerator>
36
+		
37
+        <!-- targetProject:mapper映射文件生成的位置 -->
38
+		<sqlMapGenerator targetPackage="com.chinaitop.depot.system.mapper" 
39
+			targetProject=".\src\main\java">
40
+			<!-- enableSubPackages:是否让schema作为包的后缀 -->
41
+			<property name="enableSubPackages" value="false" />
42
+		</sqlMapGenerator>
43
+		
44
+		<!-- targetPackage:mapper接口生成的位置 -->
45
+		<javaClientGenerator type="XMLMAPPER"
46
+			targetPackage="com.chinaitop.depot.system.mapper" 
47
+			targetProject=".\src\main\java">
48
+			<!-- enableSubPackages:是否让schema作为包的后缀 -->
49
+			<property name="enableSubPackages" value="false" />
50
+		</javaClientGenerator>
51
+		
52
+		<!-- 指定要反向生成的数据库表 -->
53
+		<table schema="" tableName="system_log"></table>
54
+
55
+	</context>
56
+</generatorConfiguration>