Browse Source

日志管理

git-svn-id: https://192.168.57.71/svn/jsgkj@1752 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 years ago
parent
commit
7ef77aaddc

+ 9 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/SysLogModelMapper.java

@@ -1,8 +1,17 @@
 package com.xt.js.gkaq.frame.mappers;
 
+import java.util.List;
+
 import com.xt.js.gkaq.common.BaseMapper;
 import com.xt.js.gkaq.frame.model.SysLogModel;
 
 public interface SysLogModelMapper extends BaseMapper<SysLogModel> {
 
+    /**
+     * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
+     * 
+     * @param model
+     * @return
+     */
+    List<SysLogModel> selectAllByCond(SysLogModel model);
 }

+ 10 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/SysLogService.java

@@ -1,5 +1,7 @@
 package com.xt.js.gkaq.frame.service;
 
+import java.util.List;
+
 import com.xt.js.gkaq.common.BaseUUIDModelService;
 import com.xt.js.gkaq.frame.model.SysLogModel;
 import com.xt.js.gkaq.frame.model.UserModel;
@@ -11,5 +13,13 @@ import com.xt.js.gkaq.frame.model.UserModel;
  *
  */
 public interface SysLogService extends BaseUUIDModelService<SysLogModel> {
+    /**
+     * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
+     * 
+     * @param model
+     * @return
+     */
+    public List<SysLogModel> findAllByCond(SysLogModel model);
+
     public int add(SysLogModel record, UserModel user);
 }

+ 6 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/SysLogServiceImpl.java

@@ -1,6 +1,7 @@
 package com.xt.js.gkaq.frame.service.impl;
 
 import java.util.Date;
+import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -24,6 +25,11 @@ public class SysLogServiceImpl extends BaseUUIDModelServiceImpl<SysLogModel> imp
 		return mapper;
 	}
 
+    @Override
+    public List<SysLogModel> findAllByCond(SysLogModel model) {
+        return mapper.selectAllByCond(model);
+    }
+
     @Transactional
     public int add(SysLogModel record, UserModel user) {
         record.setId(idGenerator.generateStringId());

+ 16 - 0
gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/SysLogModelMapper.xml

@@ -53,4 +53,20 @@
     UPDATE_TIME, CREATE_USER, UPDATE_USER
     from AQ_BASIC_FRAME_SYSLOG
   </select>
+  <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.SysLogModel" >
+    select ID, LOG_TYPE, LOG_PATH, LOG_PARAM, LOG_MSG, CLIENT_IP, STATE, CREATE_TIME, CREATE_USER
+    from AQ_BASIC_FRAME_SYSLOG
+    <where>
+	    <if test="logType != null and logType != ''">
+	        and LOG_TYPE = #{logType,jdbcType=VARCHAR}
+	    </if>
+	    <if test="createTime != null">
+	        and CREATE_TIME &gt;= #{createTime,jdbcType=TIMESTAMP}
+	    </if>
+	    <if test="updateTime != null">
+	        and CREATE_TIME &lt;= #{updateTime,jdbcType=TIMESTAMP}
+	    </if>
+    </where>
+    order by CREATE_TIME desc
+  </select>
 </mapper>