Browse Source

1、代码生成器修改
2、app端util管理工具-->管理token等
3、app用户表、登录日志表代码生成

qzyReal 1 year ago
parent
commit
a820416b6c

+ 1 - 1
app.pid

@@ -1 +1 @@
-12244
+30260

+ 48 - 0
sp-core/sp-base/src/main/java/com/pj/current/satoken/StpAPPUserUtil.java

@@ -0,0 +1,48 @@
+package com.pj.current.satoken;
+
+import cn.dev33.satoken.SaManager;
+import cn.dev33.satoken.stp.SaTokenInfo;
+import cn.dev33.satoken.stp.StpLogic;
+import cn.dev33.satoken.stp.StpUtil;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StpAPPUserUtil {
+    /**
+     * 账号类型标识
+     */
+    public static final String TYPE = "app";
+
+    /**
+     * 底层的 StpLogic 对象
+     */
+    public static StpLogic stpLogic = new StpLogic(TYPE);
+
+    /**
+     * 获取当前 StpLogic 的账号类型
+     * @return See Note
+     */
+    public static String getLoginType(){
+        return stpLogic.getLoginType();
+    }
+
+    /**
+     * 重置 StpLogic 对象
+     * @param stpLogic /
+     */
+    public static void setStpLogic(StpLogic stpLogic) {
+        StpUtil.stpLogic = stpLogic;
+        // 防止自定义 stpLogic 被覆盖
+        SaManager.putStpLogic(stpLogic);
+    }
+    public static void login(Object id) {
+        stpLogic.login(id);
+    }
+    public static SaTokenInfo getTokenInfo(){
+       return stpLogic.getTokenInfo();
+    }
+    public static boolean isLogin() {
+        return stpLogic.isLogin();
+    }
+
+}

+ 4 - 4
sp-generate/src/main/java/com/pj/SpGenerateApplication.java

@@ -23,7 +23,7 @@ public class SpGenerateApplication {
 		// ===================================  设置连接信息  =================================== 
         FlyConfig config = new FlyConfig();
         config.setDriverClassName("com.mysql.cj.jdbc.Driver");
-        config.setUrl("jdbc:mysql://47.101.143.145:3006/transport-system?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC");
+        config.setUrl("jdbc:mysql://47.101.143.145:3006/sp-admin?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC");
         config.setUsername("yun_user");
         config.setPassword("yun_Root@1123");
         config.setPrintSql(true);		// 是否打印sql  
@@ -38,7 +38,7 @@ public class SpGenerateApplication {
 		// ===================================  一些全局设置  =================================== 
 		GenCfgManager.cfg
 			.setProjectPath("D://project//market")	// 总项目地址 (生成代码的路径)
-	        .setServerProjectName("market-server/sp-service/transport-server")				// 服务端 - 项目名称
+	        .setServerProjectName("market-server/sp-service/sp-admin")				// 服务端 - 项目名称
 //	        .setServerProjectName("sp-com/sp-core")			// 服务端 - 项目名称 (sp-com多模块版填此格式)
 	        .setCodePath("src/main/java/")					// 服务端代码 - 存放路径 
 	        .setPackagePath( "com.pj.project")				// 服务端代码 - 总包名 
@@ -64,7 +64,7 @@ public class SpGenerateApplication {
 			.setOutFC(false)					// 是否输出FC.java工厂类
 			.setDefaultMeunIcon("el-icon-folder-opened")	// 生成后台管理页面时,默认的菜单图标
 			.setWebLibImportWay(2) 			// 前端js库导入方式(1=cdn导入, 2=本地导入[需将sa-admin附带js包复制到kj文件夹])
-			 .addTableName("tb_driver")	// 添加要生成的表 (单个添加)
+			 .addTableName("app_user","app_user_login_log")	// 添加要生成的表 (单个添加)
 //			.addTableAll()		// 添加要生成的表 (一次性添加所有表)
             .removeTableName("sp_role", "sp_role_permission", "sp_admin", "sp_apilog", "sp_cfg")	// 移除这些内置的表,不必生成代码
             ; 
@@ -77,7 +77,7 @@ public class SpGenerateApplication {
 		GenUtil.doOutMyBatis();	// 输出java代码 (mybatis版本)
 		GenUtil.doOutMyBatisService();	// 输出java代码 - 追加service层
 		GenUtil.doOutAdminHtml();	// 输出 admin后台管理页面
-		GenUtil.doOutApidoc();	// 输出 接口文档页面
+//		GenUtil.doOutApidoc();	// 输出 接口文档页面
 		
 
 		

+ 1 - 18
sp-generate/src/main/resources/freemarker/mybatis/Util.ftl

@@ -23,25 +23,8 @@ public class ${t.mkNameBig}Util {
 		${t.mkNameBig}Util.${t.varName}Mapper = ${t.varName}Mapper;
 	}
 	
-	
-	/** 
-	 * 将一个 ${t.modelName} 对象进行进行数据完整性校验 (方便add/update等接口数据校验) [G] 
-	 */
-	static void check(${t.modelName} ${t.varNameSimple}) {
-${t.getT1List_ByUtilCheck()}<#rt>
-	}
 
-	/** 
-	 * 获取一个${t.modelName} (方便复制代码用) [G] 
-	 */ 
-	static ${t.modelName} get${t.modelName}() {
-<#if  cfg.utilDocWay == 2 >		// 声明对象${cfg.line}</#if><#rt>
-		${t.modelName} ${t.varNameSimple} = new ${t.modelName}();<#if cfg.utilDocWay == 1>	// 声明对象 </#if>
-${t.getT1List_ByUtilGetModel()}<#rt>
-		return ${t.varNameSimple};
-	}
-	
-	
+
 	
 	
 	

+ 121 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUser.java

@@ -0,0 +1,121 @@
+package com.pj.project.app_user;
+
+import java.io.Serializable;
+import java.util.*;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: app_user -- 移动端账号
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(AppUser.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class AppUser extends Model<AppUser> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "app_user";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "app-user";
+	public static final String PERMISSION_CODE_ADD = "app-user-add";
+	public static final String PERMISSION_CODE_EDIT = "app-user-edit";
+	public static final String PERMISSION_CODE_DEL = "app-user-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 手机号码 
+	 */
+	private String phone;	
+
+	/**
+	 * 姓名 
+	 */
+	private String name;	
+
+	/**
+	 * 类型(1=边民,2=组长,3=商户,4=收购商,5=司机) 
+	 */
+	private String userType;	
+
+	/**
+	 * 外联id,user_type=1=>边民ID;user_type=3=>商户ID 
+	 */
+	private String fkId;	
+
+	/**
+	 * 状态(0=禁用,1=启用) 
+	 */
+	private String status;	
+
+	/**
+	 * 是否认证(0=未认证,1=已认证) 
+	 */
+	private String auth;	
+
+	/**
+	 * 人证时间 
+	 */
+	private String authTime;	
+
+	/**
+	 * 登录次数 
+	 */
+	private Long loginCount;	
+
+	/**
+	 * 上次登录时间 
+	 */
+	private String lastLoginTime;	
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;	
+
+	/**
+	 * 更新者id 
+	 */
+	private String updateById;	
+
+	/**
+	 * 更新者名称 
+	 */
+	private String updateByName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private Date updateTime;	
+
+
+
+
+
+	
+
+
+}

+ 87 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java

@@ -0,0 +1,87 @@
+package com.pj.project.app_user;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: app_user -- 移动端账号
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/AppUser/")
+public class AppUserController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	AppUserService appUserService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(AppUser.PERMISSION_CODE_ADD)
+	public AjaxJson add(AppUser a){
+		appUserService.add(a);
+		a = appUserService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(AppUser.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 appUserService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(AppUser.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(AppUser.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(AppUser.PERMISSION_CODE_EDIT)
+	public AjaxJson update(AppUser a){
+		appUserService.update(a);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(AppUser.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		AppUser a = appUserService.getById(id);
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(AppUser.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<AppUser> list = appUserService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.app_user;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: app_user -- 移动端账号
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface AppUserMapper extends BaseMapper <AppUser> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<AppUser> getList(SoMap so);
+
+
+}

+ 67 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserMapper.xml

@@ -0,0 +1,67 @@
+<?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.pj.project.app_user.AppUserMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, phone, name, user_type, fk_id, status, auth, auth_time, login_count, last_login_time, create_time, update_by_id, update_by_name, update_time from app_user  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.app_user.AppUser"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from app_user 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("phone") '> and phone = #{phone} </if>
+			<if test=' this.has("name") '> and name = #{name} </if>
+			<if test=' this.has("userType") '> and user_type = #{userType} </if>
+			<if test=' this.has("fkId") '> and fk_id = #{fkId} </if>
+			<if test=' this.has("status") '> and status = #{status} </if>
+			<if test=' this.has("auth") '> and auth = #{auth} </if>
+			<if test=' this.has("authTime") '> and auth_time = #{authTime} </if>
+			<if test=' this.has("loginCount") '> and login_count = #{loginCount} </if>
+			<if test=' this.has("lastLoginTime") '> and last_login_time = #{lastLoginTime} </if>
+			<if test=' this.has("updateById") '> and update_by_id = #{updateById} </if>
+			<if test=' this.has("updateByName") '> and update_by_name = #{updateByName} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> phone desc </when>
+			<when test='sortType == 3'> name desc </when>
+			<when test='sortType == 4'> user_type desc </when>
+			<when test='sortType == 5'> fk_id desc </when>
+			<when test='sortType == 6'> status desc </when>
+			<when test='sortType == 7'> auth desc </when>
+			<when test='sortType == 8'> auth_time desc </when>
+			<when test='sortType == 9'> login_count desc </when>
+			<when test='sortType == 10'> last_login_time desc </when>
+			<when test='sortType == 11'> create_time desc </when>
+			<when test='sortType == 12'> update_by_id desc </when>
+			<when test='sortType == 13'> update_by_name desc </when>
+			<when test='sortType == 14'> update_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -0,0 +1,51 @@
+package com.pj.project.app_user;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: app_user -- 移动端账号
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implements IService<AppUser>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	AppUserMapper appUserMapper;
+
+	/** 增 */
+	void add(AppUser a){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(AppUser a){
+		updateById(a);
+
+	}
+
+	/** 查 */
+	AppUser getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<AppUser> getList(SoMap so) { 
+		return appUserMapper.getList(so);	
+	}
+	
+
+}

+ 30 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserUtil.java

@@ -0,0 +1,30 @@
+package com.pj.project.app_user;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.pj.utils.sg.*;
+import java.util.*;
+
+/**
+ * 工具类:app_user -- 移动端账号
+ * @author qzy 
+ *
+ */
+@Component
+public class AppUserUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static AppUserMapper appUserMapper;
+	@Autowired
+	private void setAppUserMapper(AppUserMapper appUserMapper) {
+		AppUserUtil.appUserMapper = appUserMapper;
+	}
+	
+
+
+	
+	
+	
+}

+ 80 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLog.java

@@ -0,0 +1,80 @@
+package com.pj.project.app_user_login_log;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: app_user_login_log -- 移动端用户登录日志
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(AppUserLoginLog.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class AppUserLoginLog extends Model<AppUserLoginLog> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "app_user_login_log";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "app-user-login-log";
+	public static final String PERMISSION_CODE_ADD = "app-user-login-log-add";
+	public static final String PERMISSION_CODE_EDIT = "app-user-login-log-edit";
+	public static final String PERMISSION_CODE_DEL = "app-user-login-log-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 用户ID 
+	 */
+	private Long usreId;	
+
+	/**
+	 * 登录时间 
+	 */
+	private String loginTime;	
+
+	/**
+	 * 登录IP 
+	 */
+	private String loginIp;	
+
+	/**
+	 * 登录设备 
+	 */
+	private String deviceMode;	
+
+	/**
+	 * app版本号 
+	 */
+	private String appVersion;	
+
+
+
+
+
+	
+
+
+}

+ 87 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogController.java

@@ -0,0 +1,87 @@
+package com.pj.project.app_user_login_log;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: app_user_login_log -- 移动端用户登录日志
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/AppUserLoginLog/")
+public class AppUserLoginLogController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	AppUserLoginLogService appUserLoginLogService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE_ADD)
+	public AjaxJson add(AppUserLoginLog a){
+		appUserLoginLogService.add(a);
+		a = appUserLoginLogService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 appUserLoginLogService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(AppUserLoginLog.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE_EDIT)
+	public AjaxJson update(AppUserLoginLog a){
+		appUserLoginLogService.update(a);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		AppUserLoginLog a = appUserLoginLogService.getById(id);
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(AppUserLoginLog.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<AppUserLoginLog> list = appUserLoginLogService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.app_user_login_log;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: app_user_login_log -- 移动端用户登录日志
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface AppUserLoginLogMapper extends BaseMapper <AppUserLoginLog> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<AppUserLoginLog> getList(SoMap so);
+
+
+}

+ 53 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogMapper.xml

@@ -0,0 +1,53 @@
+<?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.pj.project.app_user_login_log.AppUserLoginLogMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, usre_id, login_time, login_ip, device_mode, app_version from app_user_login_log  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.app_user_login_log.AppUserLoginLog"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from app_user_login_log 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("usreId") '> and usre_id = #{usreId} </if>
+			<if test=' this.has("loginTime") '> and login_time = #{loginTime} </if>
+			<if test=' this.has("loginIp") '> and login_ip = #{loginIp} </if>
+			<if test=' this.has("deviceMode") '> and device_mode = #{deviceMode} </if>
+			<if test=' this.has("appVersion") '> and app_version = #{appVersion} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> usre_id desc </when>
+			<when test='sortType == 3'> login_time desc </when>
+			<when test='sortType == 4'> login_ip desc </when>
+			<when test='sortType == 5'> device_mode desc </when>
+			<when test='sortType == 6'> app_version desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogService.java

@@ -0,0 +1,51 @@
+package com.pj.project.app_user_login_log;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: app_user_login_log -- 移动端用户登录日志
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class AppUserLoginLogService extends ServiceImpl<AppUserLoginLogMapper, AppUserLoginLog> implements IService<AppUserLoginLog>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	AppUserLoginLogMapper appUserLoginLogMapper;
+
+	/** 增 */
+	void add(AppUserLoginLog a){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(AppUserLoginLog a){
+		updateById(a);
+
+	}
+
+	/** 查 */
+	AppUserLoginLog getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<AppUserLoginLog> getList(SoMap so) { 
+		return appUserLoginLogMapper.getList(so);	
+	}
+	
+
+}

+ 29 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user_login_log/AppUserLoginLogUtil.java

@@ -0,0 +1,29 @@
+package com.pj.project.app_user_login_log;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.pj.utils.sg.*;
+
+/**
+ * 工具类:app_user_login_log -- 移动端用户登录日志
+ * @author qzy 
+ *
+ */
+@Component
+public class AppUserLoginLogUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static AppUserLoginLogMapper appUserLoginLogMapper;
+	@Autowired
+	private void setAppUserLoginLogMapper(AppUserLoginLogMapper appUserLoginLogMapper) {
+		AppUserLoginLogUtil.appUserLoginLogMapper = appUserLoginLogMapper;
+	}
+	
+
+
+	
+	
+	
+}