ソースを参照

自定义列改id类型

LLL 1 年間 前
コミット
92a0835c83

+ 1 - 2
module_kzks/src/main/java/org/jeecg/modules/customColumns/entity/CustomColumns.java

@@ -33,9 +33,8 @@ public class CustomColumns implements Serializable {
     private static final long serialVersionUID = 1L;
 
 	/**主键*/
-	@TableId(type = IdType.ASSIGN_ID)
     @ApiModelProperty(value = "主键")
-    private java.lang.String id;
+    private java.lang.Integer id;
 	/**登录账号*/
 	@Excel(name = "登录账号", width = 15)
     @ApiModelProperty(value = "登录账号")

+ 6 - 4
module_kzks/src/main/java/org/jeecg/modules/customColumns/mapper/CustomColumnsMapper.java

@@ -1,10 +1,8 @@
 package org.jeecg.modules.customColumns.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.customColumns.entity.CustomColumns;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.customColumns.entity.CustomColumns;
 
 /**
  * @Description: 自定义列记录表
@@ -14,4 +12,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface CustomColumnsMapper extends BaseMapper<CustomColumns> {
 
+    /**根据用户账号查询该用户自定义列记录*/
+    @Select("select * from kzks_custom_columns where user_name = #{userName}")
+    public CustomColumns selectByUserName(String userName);
+
 }

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/customColumns/service/ICustomColumnsService.java

@@ -11,4 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICustomColumnsService extends IService<CustomColumns> {
 
+    /**根据用户账号查询该用户自定义列记录*/
+    public CustomColumns selectByUserName(String userName);
+
 }

+ 10 - 0
module_kzks/src/main/java/org/jeecg/modules/customColumns/service/impl/CustomColumnsServiceImpl.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.customColumns.service.impl;
 import org.jeecg.modules.customColumns.entity.CustomColumns;
 import org.jeecg.modules.customColumns.mapper.CustomColumnsMapper;
 import org.jeecg.modules.customColumns.service.ICustomColumnsService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -16,4 +17,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class CustomColumnsServiceImpl extends ServiceImpl<CustomColumnsMapper, CustomColumns> implements ICustomColumnsService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private CustomColumnsMapper customColumnsMapper;
+
+    /**根据用户账号查询该用户自定义列记录*/
+    public CustomColumns selectByUserName(String userName){
+        return customColumnsMapper.selectByUserName(userName);
+    }
+
 }