Kaynağa Gözat

1. 优化律师端所有表的查询接口 添加通用列表查询和通用分页查询 删除冗余代码
2. 更新QueryBuilder编辑器

LuTong 1 ay önce
ebeveyn
işleme
50c7f53cb0
17 değiştirilmiş dosya ile 713 ekleme ve 742 silme
  1. 96 49
      QueryBuilder使用示例.md
  2. 52 50
      alien-store/src/main/java/shop/alien/store/controller/LawyerAiInteractionLogController.java
  3. 50 50
      alien-store/src/main/java/shop/alien/store/controller/LawyerChatMessageController.java
  4. 52 52
      alien-store/src/main/java/shop/alien/store/controller/LawyerChatSessionController.java
  5. 54 52
      alien-store/src/main/java/shop/alien/store/controller/LawyerCommonQuestionController.java
  6. 69 30
      alien-store/src/main/java/shop/alien/store/controller/LawyerConsultationOrderController.java
  7. 52 50
      alien-store/src/main/java/shop/alien/store/controller/LawyerConsultationReviewController.java
  8. 52 62
      alien-store/src/main/java/shop/alien/store/controller/LawyerLegalProblemScenarioController.java
  9. 50 41
      alien-store/src/main/java/shop/alien/store/controller/LawyerPaymentTransactionController.java
  10. 50 50
      alien-store/src/main/java/shop/alien/store/controller/LawyerServiceAreaController.java
  11. 56 40
      alien-store/src/main/java/shop/alien/store/controller/LawyerUserController.java
  12. 47 47
      alien-store/src/main/java/shop/alien/store/controller/LawyerUserSearchHistoryController.java
  13. 0 31
      alien-store/src/main/java/shop/alien/store/service/LawyerLegalProblemScenarioService.java
  14. 0 21
      alien-store/src/main/java/shop/alien/store/service/LawyerServiceAreaService.java
  15. 0 63
      alien-store/src/main/java/shop/alien/store/service/impl/LawyerLegalProblemScenarioServiceImpl.java
  16. 0 40
      alien-store/src/main/java/shop/alien/store/service/impl/LawyerServiceAreaServiceImpl.java
  17. 33 14
      alien-util/src/main/java/shop/alien/util/myBaticsPlus/QueryBuilder.java

+ 96 - 49
QueryBuilder使用示例.md

@@ -91,14 +91,15 @@ public R<List<LawyerUser>> search(@ModelAttribute LawyerUser query) {
 }
 ```
 
-#### 方式三:使用Like后缀字段(自动识别)
+#### 方式三:使用_Like后缀字段(自动识别)
 
-在实体类中添加Like后缀字段(仅用于查询,不需要对应数据库字段):
+在实体类中添加_Like后缀字段(仅用于查询,不需要对应数据库字段):
 
 ```java
+// 查询实体类(继承基础实体类)
 public class LawyerUserQuery extends LawyerUser {
-    private String nameLike;  // 模糊查询姓名
-    private String phoneLike;  // 模糊查询手机号
+    private String name_Like;  // 模糊查询姓名
+    private String phone_Like;  // 模糊查询手机号
 }
 ```
 
@@ -115,17 +116,18 @@ public R<List<LawyerUser>> search(@ModelAttribute LawyerUserQuery query) {
 
 **请求示例:**
 ```
-GET /lawyer/user/search?nameLike=张&phoneLike=138
+GET /lawyer/user/search?name_Like=张&phone_Like=138
 ```
 
 ### 4. 批量查询(IN查询)
 
-在实体类中添加List后缀字段:
+在实体类中添加_List后缀字段:
 
 ```java
+// 查询实体类(继承基础实体类)
 public class LawyerUserQuery extends LawyerUser {
-    private List<Integer> idList;  // 批量查询ID
-    private List<String> statusList;  // 批量查询状态
+    private List<Integer> id_List;  // 批量查询ID
+    private List<String> status_List;  // 批量查询状态
 }
 ```
 
@@ -142,7 +144,7 @@ public R<List<LawyerUser>> getByIds(@ModelAttribute LawyerUserQuery query) {
 
 **请求示例:**
 ```
-GET /lawyer/user/getByIds?idList=1&idList=2&idList=3
+GET /lawyer/user/getByIds?id_List=1&id_List=2&id_List=3
 ```
 
 **生成的SQL:**
@@ -152,14 +154,15 @@ WHERE id IN (1, 2, 3)
 
 ### 5. 范围查询
 
-在实体类中添加Start/End后缀字段:
+在实体类中添加_Start/_End后缀字段:
 
 ```java
+// 查询实体类(继承基础实体类)
 public class LawyerUserQuery extends LawyerUser {
-    private Date createdTimeStart;  // 创建时间开始
-    private Date createdTimeEnd;    // 创建时间结束
-    private Integer serviceCountStart;  // 服务次数范围开始
-    private Integer serviceCountEnd;    // 服务次数范围结束
+    private Date createdTime_Start;  // 创建时间开始
+    private Date createdTime_End;    // 创建时间结束
+    private Integer serviceCount_Start;  // 服务次数范围开始
+    private Integer serviceCount_End;    // 服务次数范围结束
 }
 ```
 
@@ -176,7 +179,7 @@ public R<List<LawyerUser>> getByTimeRange(@ModelAttribute LawyerUserQuery query)
 
 **请求示例:**
 ```
-GET /lawyer/user/getByTimeRange?createdTimeStart=2025-01-01&createdTimeEnd=2025-01-31
+GET /lawyer/user/getByTimeRange?createdTime_Start=2025-01-01&createdTime_End=2025-01-31
 ```
 
 **生成的SQL:**
@@ -208,7 +211,7 @@ public R<IPage<LawyerUser>> complexQuery(
 
 **请求示例:**
 ```
-GET /lawyer/user/complexQuery?name=张&phone=138&status=1&createdTimeStart=2025-01-01&createdTimeEnd=2025-01-31&pageNum=1&pageSize=10
+GET /lawyer/user/complexQuery?name=张&phone=138&status=1&createdTime_Start=2025-01-01&createdTime_End=2025-01-31&pageNum=1&pageSize=10
 ```
 
 **生成的SQL:**
@@ -232,36 +235,64 @@ QueryBuilder.of(queryEntity)
 
 #### 2. `ignoreEmptyStr(boolean ignore)` - 设置是否忽略空字符串
 ```java
-.ignoreEmptyStr(true)   // 默认true,忽略空字符串
-.ignoreEmptyStr(false)  // 保留空字符串作为查询条件
+QueryBuilder.of(query)
+    .ignoreEmptyStr(true)   // 默认true,忽略空字符串
+    .build()
+    .list(service);
+
+QueryBuilder.of(query)
+    .ignoreEmptyStr(false)  // 保留空字符串作为查询条件
+    .build()
+    .list(service);
 ```
 
 #### 3. `stringFieldLike(boolean like)` - 设置String字段是否默认模糊查询
 ```java
-.stringFieldLike(true)   // 所有String字段使用模糊查询
-.stringFieldLike(false)  // 所有String字段使用等值查询(默认)
+QueryBuilder.of(query)
+    .stringFieldLike(true)   // 所有String字段使用模糊查询
+    .build()
+    .list(service);
+
+QueryBuilder.of(query)
+    .stringFieldLike(false)  // 所有String字段使用等值查询(默认)
+    .build()
+    .list(service);
 ```
 
 #### 4. `likeFields(String... fieldNames)` - 指定字段使用模糊查询
 ```java
-.likeFields("name")              // 单个字段
-.likeFields("name", "phone")     // 多个字段
+QueryBuilder.of(query)
+    .likeFields("name")              // 单个字段
+    .build()
+    .list(service);
+
+QueryBuilder.of(query)
+    .likeFields("name", "phone")     // 多个字段
+    .build()
+    .list(service);
 ```
 
 #### 5. `page(int pageNum, int pageSize)` - 设置分页参数
 ```java
-.page(1, 10)  // 第1页,每页10条
+QueryBuilder.of(query)
+    .page(1, 10)  // 第1页,每页10条
+    .build()
+    .page(service);
 ```
 
 #### 6. `page(Page<T> page)` - 设置分页对象
 ```java
 Page<LawyerUser> pageObj = new Page<>(1, 10);
-.page(pageObj)
+QueryBuilder.of(query)
+    .page(pageObj)
+    .build()
+    .page(service);
 ```
 
 #### 7. `build()` - 构建查询条件
 ```java
-.build()  // 返回 QueryResult 对象
+QueryResult<LawyerUser> result = QueryBuilder.of(query)
+    .build();  // 返回 QueryResult 对象
 ```
 
 ### QueryResult 方法
@@ -301,28 +332,28 @@ System.out.println(wrapper.getTargetSql());  // 打印SQL
 .likeFields("name", "phone")  // 在代码中指定
 ```
 
-**方式二:字段名以 `Like` 结尾**
-- 字段名以 `Like` 结尾
-- 示例:`nameLike` → 查询 `name` 字段,使用 `LIKE '%value%'`
+**方式二:字段名以 `_Like` 结尾**
+- 字段名以 `_Like` 结尾
+- 示例:`name_Like` → 查询 `name` 字段,使用 `LIKE '%value%'`
 
 ### 2. 批量查询字段
 - 字段类型为 `Collection`(List、Set等)
-- 字段名以 `List` 结尾(推荐)
-- 示例:`idList` → 查询 `id` 字段,使用 `IN (1,2,3)`
+- 字段名以 `_List` 结尾(推荐)
+- 示例:`id_List` → 查询 `id` 字段,使用 `IN (1,2,3)`
 
 ### 3. 范围查询字段
-- 字段名以 `Start` 或 `End` 结尾
-- 成对出现:`xxxStart` 和 `xxxEnd`
+- 字段名以 `_Start` 或 `_End` 结尾
+- 成对出现:`xxx_Start` 和 `xxx_End`
 - 示例:
-  - `createdTimeStart` → `createdTime >= value`
-  - `createdTimeEnd` → `createdTime <= value`
+  - `createdTime_Start` → `createdTime >= value`
+  - `createdTime_End` → `createdTime <= value`
 
 ## 六、查询优先级
 
 ### 模糊查询优先级
 
 1. **最高优先级**:`likeFields()` 方法指定的字段
-2. **次优先级**:字段名以 `Like` 结尾的字段
+2. **次优先级**:字段名以 `_Like` 结尾的字段
 3. **全局设置**:`stringFieldLike(true)` 时,所有String字段使用模糊查询
 4. **默认**:等值查询(`=`)
 
@@ -333,6 +364,7 @@ QueryBuilder.of(query)
     .stringFieldLike(true)      // 全局:所有String字段模糊查询
     .likeFields("name")         // 指定:name字段模糊查询(优先级更高)
     .build()
+    .list(service);
 ```
 
 **结果:**
@@ -345,28 +377,36 @@ QueryBuilder.of(query)
 ### 实体类定义
 
 ```java
+import java.util.Date;
+import java.util.List;
+import lombok.Data;
+
 @Data
 public class LawyerUserQuery extends LawyerUser {
     // 模糊查询字段(方式一:在代码中指定,不需要在实体类中定义)
-    // 方式二:使用Like后缀字段
-    private String nameLike;
-    private String phoneLike;
+    // 方式二:使用_Like后缀字段
+    private String name_Like;
+    private String phone_Like;
     
     // 批量查询字段
-    private List<Integer> idList;
-    private List<Integer> statusList;
+    private List<Integer> id_List;
+    private List<Integer> status_List;
     
     // 范围查询字段
-    private Date createdTimeStart;
-    private Date createdTimeEnd;
-    private Integer serviceCountStart;
-    private Integer serviceCountEnd;
+    private Date createdTime_Start;
+    private Date createdTime_End;
+    private Integer serviceCount_Start;
+    private Integer serviceCount_End;
 }
 ```
 
 ### Controller 完整示例
 
 ```java
+import org.springframework.web.bind.annotation.*;
+import lombok.RequiredArgsConstructor;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
 @RestController
 @RequestMapping("/lawyer/user")
 @RequiredArgsConstructor
@@ -455,26 +495,31 @@ public class LawyerUserController {
 // 方式一:使用全局模糊查询,然后排除特定字段
 QueryBuilder.of(query)
     .stringFieldLike(true)  // 全局模糊查询
-    // 注意:没有单独排除的方法,可以使用Like后缀字段的方式
+    .build()
+    .list(service);
+// 注意:没有单独排除的方法,可以使用Like后缀字段的方式
     
 // 方式二:只指定需要模糊查询的字段
 QueryBuilder.of(query)
     .likeFields("name", "phone")  // 只指定这些字段模糊查询
     .build()
+    .list(service);
 ```
 
 ### Q2: 如何同时使用等值查询和模糊查询?
 
 ```java
 // 在实体类中定义两个字段
+// 查询实体类(继承基础实体类)
 public class LawyerUserQuery extends LawyerUser {
     private String name;        // 等值查询
-    private String nameLike;    // 模糊查询
+    private String name_Like;    // 模糊查询
 }
 
 // 使用时
 QueryBuilder.of(query)
-    .build()  // name使用等值查询,nameLike使用模糊查询
+    .build()  // name使用等值查询,name_Like使用模糊查询
+    .list(service);
 ```
 
 ### Q3: 如何查询空值?
@@ -483,6 +528,7 @@ QueryBuilder.of(query)
 QueryBuilder.of(query)
     .ignoreEmptyStr(false)  // 不忽略空字符串
     .build()
+    .list(service);
 ```
 
 ### Q4: 如何调试生成的SQL?
@@ -504,8 +550,8 @@ QueryBuilder.of(query)
     .build()
     .list(service);
 
-// ✅ 推荐:使用Like后缀字段(更灵活)
-// 在实体类中定义 nameLike 字段
+// ✅ 推荐:使用_Like后缀字段(更灵活)
+// 在实体类中定义 name_Like 字段
 QueryBuilder.of(query)
     .build()
     .list(service);
@@ -518,6 +564,7 @@ QueryBuilder.of(query)
 QueryBuilder.of(query)
     .stringFieldLike(true)  // 除非你真的需要所有String字段都模糊
     .build()
+    .list(service);
 ```
 
 ### 3. 性能优化建议

+ 52 - 50
alien-store/src/main/java/shop/alien/store/controller/LawyerAiInteractionLogController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerAiInteractionLog;
 import shop.alien.store.service.LawyerAiInteractionLogService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,54 +29,8 @@ public class LawyerAiInteractionLogController {
 
     private final LawyerAiInteractionLogService aiInteractionLogService;
 
-    @ApiOperation("获取所有AI交互日志")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerAiInteractionLog>> getAll() {
-        log.info("LawyerAiInteractionLogController.getAll");
-        return R.data(aiInteractionLogService.list());
-    }
-
-    @ApiOperation("根据id获取AI交互日志")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerAiInteractionLog> getOne(Integer id) {
-        log.info("LawyerAiInteractionLogController.getOne?id={}", id);
-        return R.data(aiInteractionLogService.getById(id));
-    }
-
-    @ApiOperation("根据会话ID查询交互日志列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "conversationId", value = "会话ID", dataType = "String", paramType = "query", required = true)})
-    @GetMapping("/getListByConversationId")
-    public R<List<LawyerAiInteractionLog>> getListByConversationId(String conversationId) {
-        log.info("LawyerAiInteractionLogController.getListByConversationId?conversationId={}", conversationId);
-        return R.data(aiInteractionLogService.getListByConversationId(conversationId));
-    }
-
-    @ApiOperation("分页查询AI交互日志列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "conversationId", value = "会话ID", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getAiInteractionLogList")
-    public R<IPage<LawyerAiInteractionLog>> getAiInteractionLogList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                @RequestParam(defaultValue = "10") int pageSize,
-                                                                @RequestParam(required = false) Integer clientUserId,
-                                                                @RequestParam(required = false) String conversationId,
-                                                                @RequestParam(required = false) Integer problemScenarId) {
-        log.info("LawyerAiInteractionLogController.getAiInteractionLogList?pageNum={},pageSize={},clientUserId={},conversationId={},problemScenarId={}",
-                pageNum, pageSize, clientUserId, conversationId, problemScenarId);
-        return aiInteractionLogService.getAiInteractionLogList(pageNum, pageSize, clientUserId, conversationId, problemScenarId);
-    }
-
     @ApiOperation("新增AI交互日志")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addAiInteractionLog")
     public R<LawyerAiInteractionLog> addAiInteractionLog(@RequestBody LawyerAiInteractionLog aiInteractionLog) {
         log.info("LawyerAiInteractionLogController.addAiInteractionLog?aiInteractionLog={}", aiInteractionLog);
@@ -83,7 +38,7 @@ public class LawyerAiInteractionLogController {
     }
 
     @ApiOperation("编辑AI交互日志")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editAiInteractionLog")
     public R<LawyerAiInteractionLog> editAiInteractionLog(@RequestBody LawyerAiInteractionLog aiInteractionLog) {
         log.info("LawyerAiInteractionLogController.editAiInteractionLog?aiInteractionLog={}", aiInteractionLog);
@@ -91,7 +46,7 @@ public class LawyerAiInteractionLogController {
     }
 
     @ApiOperation("删除AI交互日志")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteAiInteractionLog")
     public R<Boolean> deleteAiInteractionLog(@RequestParam(value = "id") Integer id) {
         log.info("LawyerAiInteractionLogController.deleteAiInteractionLog?id={}", id);
@@ -99,7 +54,7 @@ public class LawyerAiInteractionLogController {
     }
 
     @ApiOperation("保存或更新AI交互日志")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerAiInteractionLog> saveOrUpdate(@RequestBody LawyerAiInteractionLog aiInteractionLog) {
         log.info("LawyerAiInteractionLogController.saveOrUpdate?aiInteractionLog={}", aiInteractionLog);
@@ -109,5 +64,52 @@ public class LawyerAiInteractionLogController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "conversationId", value = "会话ID(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerAiInteractionLog>> getList(@ModelAttribute LawyerAiInteractionLog aiInteractionLog) {
+        log.info("LawyerAiInteractionLogController.getList?aiInteractionLog={}", aiInteractionLog);
+        List<LawyerAiInteractionLog> list = QueryBuilder.of(aiInteractionLog)
+                .likeFields("conversationId")  // 会话ID支持模糊查询
+                .build()
+                .list(aiInteractionLogService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "conversationId", value = "会话ID(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerAiInteractionLog>> getPage(@ModelAttribute LawyerAiInteractionLog aiInteractionLog,
+                                                     @RequestParam(defaultValue = "1") int page,
+                                                     @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerAiInteractionLogController.getPage?aiInteractionLog={},page={},size={}", aiInteractionLog, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerAiInteractionLog> pageResult = QueryBuilder.of(aiInteractionLog)
+                .likeFields("conversationId")  // 会话ID支持模糊查询
+                .page(pageNum, pageSize)
+                .build()
+                .page(aiInteractionLogService);
+        return R.data(pageResult);
+    }
 }
 

+ 50 - 50
alien-store/src/main/java/shop/alien/store/controller/LawyerChatMessageController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerChatMessage;
 import shop.alien.store.service.LawyerChatMessageService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,54 +29,8 @@ public class LawyerChatMessageController {
 
     private final LawyerChatMessageService chatMessageService;
 
-    @ApiOperation("获取所有聊天消息")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerChatMessage>> getAll() {
-        log.info("LawyerChatMessageController.getAll");
-        return R.data(chatMessageService.list());
-    }
-
-    @ApiOperation("根据id获取聊天消息")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerChatMessage> getOne(Integer id) {
-        log.info("LawyerChatMessageController.getOne?id={}", id);
-        return R.data(chatMessageService.getById(id));
-    }
-
-    @ApiOperation("根据会话ID查询消息列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "chatSessionId", value = "聊天会话ID", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getListBySessionId")
-    public R<List<LawyerChatMessage>> getListBySessionId(Integer chatSessionId) {
-        log.info("LawyerChatMessageController.getListBySessionId?chatSessionId={}", chatSessionId);
-        return R.data(chatMessageService.getListBySessionId(chatSessionId));
-    }
-
-    @ApiOperation("分页查询聊天消息列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "chatSessionId", value = "聊天会话ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "senderType", value = "发送者类型", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getChatMessageList")
-    public R<IPage<LawyerChatMessage>> getChatMessageList(@RequestParam(defaultValue = "1") int pageNum,
-                                                      @RequestParam(defaultValue = "10") int pageSize,
-                                                      @RequestParam(required = false) Integer chatSessionId,
-                                                      @RequestParam(required = false) Integer consultationOrderId,
-                                                      @RequestParam(required = false) Integer senderType) {
-        log.info("LawyerChatMessageController.getChatMessageList?pageNum={},pageSize={},chatSessionId={},consultationOrderId={},senderType={}",
-                pageNum, pageSize, chatSessionId, consultationOrderId, senderType);
-        return chatMessageService.getChatMessageList(pageNum, pageSize, chatSessionId, consultationOrderId, senderType);
-    }
-
     @ApiOperation("新增聊天消息")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addChatMessage")
     public R<LawyerChatMessage> addChatMessage(@RequestBody LawyerChatMessage chatMessage) {
         log.info("LawyerChatMessageController.addChatMessage?chatMessage={}", chatMessage);
@@ -83,7 +38,7 @@ public class LawyerChatMessageController {
     }
 
     @ApiOperation("编辑聊天消息")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editChatMessage")
     public R<LawyerChatMessage> editChatMessage(@RequestBody LawyerChatMessage chatMessage) {
         log.info("LawyerChatMessageController.editChatMessage?chatMessage={}", chatMessage);
@@ -91,7 +46,7 @@ public class LawyerChatMessageController {
     }
 
     @ApiOperation("删除聊天消息")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteChatMessage")
     public R<Boolean> deleteChatMessage(@RequestParam(value = "id") Integer id) {
         log.info("LawyerChatMessageController.deleteChatMessage?id={}", id);
@@ -99,7 +54,7 @@ public class LawyerChatMessageController {
     }
 
     @ApiOperation("保存或更新聊天消息")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerChatMessage> saveOrUpdate(@RequestBody LawyerChatMessage chatMessage) {
         log.info("LawyerChatMessageController.saveOrUpdate?chatMessage={}", chatMessage);
@@ -109,5 +64,50 @@ public class LawyerChatMessageController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "chatSessionId", value = "聊天会话ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "senderType", value = "发送者类型", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerChatMessage>> getList(@ModelAttribute LawyerChatMessage chatMessage) {
+        log.info("LawyerChatMessageController.getList?chatMessage={}", chatMessage);
+        List<LawyerChatMessage> list = QueryBuilder.of(chatMessage)
+                .build()
+                .list(chatMessageService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "chatSessionId", value = "聊天会话ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "senderType", value = "发送者类型", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerChatMessage>> getPage(@ModelAttribute LawyerChatMessage chatMessage,
+                                               @RequestParam(defaultValue = "1") int page,
+                                               @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerChatMessageController.getPage?chatMessage={},page={},size={}", chatMessage, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerChatMessage> pageResult = QueryBuilder.of(chatMessage)
+                .page(pageNum, pageSize)
+                .build()
+                .page(chatMessageService);
+        return R.data(pageResult);
+    }
 }
 

+ 52 - 52
alien-store/src/main/java/shop/alien/store/controller/LawyerChatSessionController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerChatSession;
 import shop.alien.store.service.LawyerChatSessionService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,56 +29,8 @@ public class LawyerChatSessionController {
 
     private final LawyerChatSessionService chatSessionService;
 
-    @ApiOperation("获取所有聊天会话")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerChatSession>> getAll() {
-        log.info("LawyerChatSessionController.getAll");
-        return R.data(chatSessionService.list());
-    }
-
-    @ApiOperation("根据id获取聊天会话")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerChatSession> getOne(Integer id) {
-        log.info("LawyerChatSessionController.getOne?id={}", id);
-        return R.data(chatSessionService.getById(id));
-    }
-
-    @ApiOperation("根据订单ID获取聊天会话")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getByOrderId")
-    public R<LawyerChatSession> getByOrderId(Integer consultationOrderId) {
-        log.info("LawyerChatSessionController.getByOrderId?consultationOrderId={}", consultationOrderId);
-        return R.data(chatSessionService.getByOrderId(consultationOrderId));
-    }
-
-    @ApiOperation("分页查询聊天会话列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "会话状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getChatSessionList")
-    public R<IPage<LawyerChatSession>> getChatSessionList(@RequestParam(defaultValue = "1") int pageNum,
-                                                      @RequestParam(defaultValue = "10") int pageSize,
-                                                      @RequestParam(required = false) Integer consultationOrderId,
-                                                      @RequestParam(required = false) Integer clientUserId,
-                                                      @RequestParam(required = false) Integer lawyerUserId,
-                                                      @RequestParam(required = false) Integer status) {
-        log.info("LawyerChatSessionController.getChatSessionList?pageNum={},pageSize={},consultationOrderId={},clientUserId={},lawyerUserId={},status={}",
-                pageNum, pageSize, consultationOrderId, clientUserId, lawyerUserId, status);
-        return chatSessionService.getChatSessionList(pageNum, pageSize, consultationOrderId, clientUserId, lawyerUserId, status);
-    }
-
     @ApiOperation("新增聊天会话")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addChatSession")
     public R<LawyerChatSession> addChatSession(@RequestBody LawyerChatSession chatSession) {
         log.info("LawyerChatSessionController.addChatSession?chatSession={}", chatSession);
@@ -85,7 +38,7 @@ public class LawyerChatSessionController {
     }
 
     @ApiOperation("编辑聊天会话")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editChatSession")
     public R<LawyerChatSession> editChatSession(@RequestBody LawyerChatSession chatSession) {
         log.info("LawyerChatSessionController.editChatSession?chatSession={}", chatSession);
@@ -93,7 +46,7 @@ public class LawyerChatSessionController {
     }
 
     @ApiOperation("删除聊天会话")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteChatSession")
     public R<Boolean> deleteChatSession(@RequestParam(value = "id") Integer id) {
         log.info("LawyerChatSessionController.deleteChatSession?id={}", id);
@@ -101,7 +54,7 @@ public class LawyerChatSessionController {
     }
 
     @ApiOperation("保存或更新聊天会话")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerChatSession> saveOrUpdate(@RequestBody LawyerChatSession chatSession) {
         log.info("LawyerChatSessionController.saveOrUpdate?chatSession={}", chatSession);
@@ -111,5 +64,52 @@ public class LawyerChatSessionController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "会话状态", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerChatSession>> getList(@ModelAttribute LawyerChatSession chatSession) {
+        log.info("LawyerChatSessionController.getList?chatSession={}", chatSession);
+        List<LawyerChatSession> list = QueryBuilder.of(chatSession)
+                .build()
+                .list(chatSessionService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "会话状态", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerChatSession>> getPage(@ModelAttribute LawyerChatSession chatSession,
+                                              @RequestParam(defaultValue = "1") int page,
+                                              @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerChatSessionController.getPage?chatSession={},page={},size={}", chatSession, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerChatSession> pageResult = QueryBuilder.of(chatSession)
+                .page(pageNum, pageSize)
+                .build()
+                .page(chatSessionService);
+        return R.data(pageResult);
+    }
 }
 

+ 54 - 52
alien-store/src/main/java/shop/alien/store/controller/LawyerCommonQuestionController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerCommonQuestion;
 import shop.alien.store.service.LawyerCommonQuestionService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,56 +29,8 @@ public class LawyerCommonQuestionController {
 
     private final LawyerCommonQuestionService commonQuestionService;
 
-    @ApiOperation("获取所有常见问题")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerCommonQuestion>> getAll() {
-        log.info("LawyerCommonQuestionController.getAll");
-        return R.data(commonQuestionService.list());
-    }
-
-    @ApiOperation("根据id获取常见问题")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerCommonQuestion> getOne(Integer id) {
-        log.info("LawyerCommonQuestionController.getOne?id={}", id);
-        return R.data(commonQuestionService.getById(id));
-    }
-
-    @ApiOperation("根据分类类型查询常见问题列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "categoryType", value = "分类类型, 0:推荐, 1:常见问题", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getListByCategoryType")
-    public R<List<LawyerCommonQuestion>> getListByCategoryType(Integer categoryType) {
-        log.info("LawyerCommonQuestionController.getListByCategoryType?categoryType={}", categoryType);
-        return R.data(commonQuestionService.getListByCategoryType(categoryType));
-    }
-
-    @ApiOperation("分页查询常见问题列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "questionText", value = "问题文本", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "categoryType", value = "分类类型", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getCommonQuestionList")
-    public R<IPage<LawyerCommonQuestion>> getCommonQuestionList(@RequestParam(defaultValue = "1") int pageNum,
-                                                           @RequestParam(defaultValue = "10") int pageSize,
-                                                           @RequestParam(required = false) String questionText,
-                                                           @RequestParam(required = false) Integer categoryType,
-                                                           @RequestParam(required = false) Integer problemScenarId,
-                                                           @RequestParam(required = false) Integer status) {
-        log.info("LawyerCommonQuestionController.getCommonQuestionList?pageNum={},pageSize={},questionText={},categoryType={},problemScenarId={},status={}",
-                pageNum, pageSize, questionText, categoryType, problemScenarId, status);
-        return commonQuestionService.getCommonQuestionList(pageNum, pageSize, questionText, categoryType, problemScenarId, status);
-    }
-
     @ApiOperation("新增常见问题")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addCommonQuestion")
     public R<LawyerCommonQuestion> addCommonQuestion(@RequestBody LawyerCommonQuestion commonQuestion) {
         log.info("LawyerCommonQuestionController.addCommonQuestion?commonQuestion={}", commonQuestion);
@@ -85,7 +38,7 @@ public class LawyerCommonQuestionController {
     }
 
     @ApiOperation("编辑常见问题")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editCommonQuestion")
     public R<LawyerCommonQuestion> editCommonQuestion(@RequestBody LawyerCommonQuestion commonQuestion) {
         log.info("LawyerCommonQuestionController.editCommonQuestion?commonQuestion={}", commonQuestion);
@@ -93,7 +46,7 @@ public class LawyerCommonQuestionController {
     }
 
     @ApiOperation("删除常见问题")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteCommonQuestion")
     public R<Boolean> deleteCommonQuestion(@RequestParam(value = "id") Integer id) {
         log.info("LawyerCommonQuestionController.deleteCommonQuestion?id={}", id);
@@ -101,7 +54,7 @@ public class LawyerCommonQuestionController {
     }
 
     @ApiOperation("保存或更新常见问题")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerCommonQuestion> saveOrUpdate(@RequestBody LawyerCommonQuestion commonQuestion) {
         log.info("LawyerCommonQuestionController.saveOrUpdate?commonQuestion={}", commonQuestion);
@@ -111,5 +64,54 @@ public class LawyerCommonQuestionController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "questionText", value = "问题文本(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "categoryType", value = "分类类型, 0:推荐, 1:常见问题", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerCommonQuestion>> getList(@ModelAttribute LawyerCommonQuestion commonQuestion) {
+        log.info("LawyerCommonQuestionController.getList?commonQuestion={}", commonQuestion);
+        List<LawyerCommonQuestion> list = QueryBuilder.of(commonQuestion)
+                .likeFields("questionText")  // 问题文本支持模糊查询
+                .build()
+                .list(commonQuestionService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "questionText", value = "问题文本(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "categoryType", value = "分类类型, 0:推荐, 1:常见问题", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerCommonQuestion>> getPage(@ModelAttribute LawyerCommonQuestion commonQuestion,
+                                                  @RequestParam(defaultValue = "1") int page,
+                                                  @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerCommonQuestionController.getPage?commonQuestion={},page={},size={}", commonQuestion, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerCommonQuestion> pageResult = QueryBuilder.of(commonQuestion)
+                .likeFields("questionText")  // 问题文本支持模糊查询
+                .page(pageNum, pageSize)
+                .build()
+                .page(commonQuestionService);
+        return R.data(pageResult);
+    }
 }
 

+ 69 - 30
alien-store/src/main/java/shop/alien/store/controller/LawyerConsultationOrderController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerConsultationOrder;
 import shop.alien.store.service.LawyerConsultationOrderService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,49 +29,34 @@ public class LawyerConsultationOrderController {
 
     private final LawyerConsultationOrderService consultationOrderService;
 
-    @ApiOperation("获取所有咨询订单")
+    @ApiOperation("分页查询咨询订单列表(支持按律师姓名关联查询)")
     @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerConsultationOrder>> getAll() {
-        log.info("LawyerConsultationOrderController.getAll");
-        return R.data(consultationOrderService.list());
-    }
-
-    @ApiOperation("根据id获取咨询订单")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerConsultationOrder> getOne(Integer id) {
-        log.info("LawyerConsultationOrderController.getOne?id={}", id);
-        return R.data(consultationOrderService.getById(id));
-    }
-
-    @ApiOperation("分页查询咨询订单列表")
-    @ApiOperationSupport(order = 3)
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
             @ApiImplicitParam(name = "orderNumber", value = "订单编号", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "lawyerName", value = "律师姓名", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "orderStatus", value = "订单状态", dataType = "Integer", paramType = "query")
+            @ApiImplicitParam(name = "lawyerName", value = "律师姓名(支持模糊查询,关联查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query")
     })
     @GetMapping("/getConsultationOrderList")
-    public R<IPage<LawyerConsultationOrder>> getConsultationOrderList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                 @RequestParam(defaultValue = "10") int pageSize,
+    public R<IPage<LawyerConsultationOrder>> getConsultationOrderList(@RequestParam(defaultValue = "1") int page,
+                                                                 @RequestParam(defaultValue = "10") int size,
                                                                  @RequestParam(required = false) String orderNumber,
                                                                  @RequestParam(required = false) Integer clientUserId,
                                                                  @RequestParam(required = false) Integer lawyerUserId,
                                                                  @RequestParam(required = false) String lawyerName,
                                                                  @RequestParam(required = false) Integer orderStatus) {
-        log.info("LawyerConsultationOrderController.getConsultationOrderList?pageNum={},pageSize={},orderNumber={},clientUserId={},lawyerUserId={},lawyerName={},orderStatus={}",
-                pageNum, pageSize, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
+        log.info("LawyerConsultationOrderController.getConsultationOrderList?page={},size={},orderNumber={},clientUserId={},lawyerUserId={},lawyerName={},orderStatus={}",
+                page, size, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
         return consultationOrderService.getConsultationOrderList(pageNum, pageSize, orderNumber, clientUserId, lawyerUserId, lawyerName, orderStatus);
     }
 
     @ApiOperation("新增咨询订单")
-    @ApiOperationSupport(order = 4)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/addConsultationOrder")
     public R<LawyerConsultationOrder> addConsultationOrder(@RequestBody LawyerConsultationOrder consultationOrder) {
         log.info("LawyerConsultationOrderController.addConsultationOrder?consultationOrder={}", consultationOrder);
@@ -78,7 +64,7 @@ public class LawyerConsultationOrderController {
     }
 
     @ApiOperation("编辑咨询订单")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 3)
     @PostMapping("/editConsultationOrder")
     public R<LawyerConsultationOrder> editConsultationOrder(@RequestBody LawyerConsultationOrder consultationOrder) {
         log.info("LawyerConsultationOrderController.editConsultationOrder?consultationOrder={}", consultationOrder);
@@ -86,7 +72,7 @@ public class LawyerConsultationOrderController {
     }
 
     @ApiOperation("删除咨询订单")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 4)
     @DeleteMapping("/deleteConsultationOrder")
     public R<Boolean> deleteConsultationOrder(@RequestParam(value = "id") Integer id) {
         log.info("LawyerConsultationOrderController.deleteConsultationOrder?id={}", id);
@@ -94,7 +80,7 @@ public class LawyerConsultationOrderController {
     }
 
     @ApiOperation("保存或更新咨询订单")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 5)
     @PostMapping("/saveOrUpdate")
     public R<LawyerConsultationOrder> saveOrUpdate(@RequestBody LawyerConsultationOrder consultationOrder) {
         log.info("LawyerConsultationOrderController.saveOrUpdate?consultationOrder={}", consultationOrder);
@@ -104,5 +90,58 @@ public class LawyerConsultationOrderController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "orderNumber", value = "订单编号(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "paymentStatus", value = "支付状态, 0:未支付, 1:已支付", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerConsultationOrder>> getList(@ModelAttribute LawyerConsultationOrder consultationOrder) {
+        log.info("LawyerConsultationOrderController.getList?consultationOrder={}", consultationOrder);
+        List<LawyerConsultationOrder> list = QueryBuilder.of(consultationOrder)
+                .likeFields("orderNumber")  // 订单编号支持模糊查询
+                .build()
+                .list(consultationOrderService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 7)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "orderNumber", value = "订单编号(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "orderStatus", value = "订单状态, 0:待支付, 1:已支付, 2:进行中, 3:已完成, 4:已取消", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "paymentStatus", value = "支付状态, 0:未支付, 1:已支付", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerConsultationOrder>> getPage(@ModelAttribute LawyerConsultationOrder consultationOrder,
+                                                      @RequestParam(defaultValue = "1") int page,
+                                                      @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerConsultationOrderController.getPage?consultationOrder={},page={},size={}", consultationOrder, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerConsultationOrder> pageResult = QueryBuilder.of(consultationOrder)
+                .likeFields("orderNumber")  // 订单编号支持模糊查询
+                .page(pageNum, pageSize)
+                .build()
+                .page(consultationOrderService);
+        return R.data(pageResult);
+    }
 }
 

+ 52 - 50
alien-store/src/main/java/shop/alien/store/controller/LawyerConsultationReviewController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerConsultationReview;
 import shop.alien.store.service.LawyerConsultationReviewService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,54 +29,8 @@ public class LawyerConsultationReviewController {
 
     private final LawyerConsultationReviewService consultationReviewService;
 
-    @ApiOperation("获取所有咨询评价")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerConsultationReview>> getAll() {
-        log.info("LawyerConsultationReviewController.getAll");
-        return R.data(consultationReviewService.list());
-    }
-
-    @ApiOperation("根据id获取咨询评价")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerConsultationReview> getOne(Integer id) {
-        log.info("LawyerConsultationReviewController.getOne?id={}", id);
-        return R.data(consultationReviewService.getById(id));
-    }
-
-    @ApiOperation("根据律师ID查询评价列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getListByLawyerId")
-    public R<List<LawyerConsultationReview>> getListByLawyerId(Integer lawyerUserId) {
-        log.info("LawyerConsultationReviewController.getListByLawyerId?lawyerUserId={}", lawyerUserId);
-        return R.data(consultationReviewService.getListByLawyerId(lawyerUserId));
-    }
-
-    @ApiOperation("分页查询咨询评价列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getConsultationReviewList")
-    public R<IPage<LawyerConsultationReview>> getConsultationReviewList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                   @RequestParam(defaultValue = "10") int pageSize,
-                                                                   @RequestParam(required = false) Integer consultationOrderId,
-                                                                   @RequestParam(required = false) Integer lawyerUserId,
-                                                                   @RequestParam(required = false) Integer clientUserId) {
-        log.info("LawyerConsultationReviewController.getConsultationReviewList?pageNum={},pageSize={},consultationOrderId={},lawyerUserId={},clientUserId={}",
-                pageNum, pageSize, consultationOrderId, lawyerUserId, clientUserId);
-        return consultationReviewService.getConsultationReviewList(pageNum, pageSize, consultationOrderId, lawyerUserId, clientUserId);
-    }
-
     @ApiOperation("新增咨询评价")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addConsultationReview")
     public R<LawyerConsultationReview> addConsultationReview(@RequestBody LawyerConsultationReview consultationReview) {
         log.info("LawyerConsultationReviewController.addConsultationReview?consultationReview={}", consultationReview);
@@ -83,7 +38,7 @@ public class LawyerConsultationReviewController {
     }
 
     @ApiOperation("编辑咨询评价")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editConsultationReview")
     public R<LawyerConsultationReview> editConsultationReview(@RequestBody LawyerConsultationReview consultationReview) {
         log.info("LawyerConsultationReviewController.editConsultationReview?consultationReview={}", consultationReview);
@@ -91,7 +46,7 @@ public class LawyerConsultationReviewController {
     }
 
     @ApiOperation("删除咨询评价")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteConsultationReview")
     public R<Boolean> deleteConsultationReview(@RequestParam(value = "id") Integer id) {
         log.info("LawyerConsultationReviewController.deleteConsultationReview?id={}", id);
@@ -99,7 +54,7 @@ public class LawyerConsultationReviewController {
     }
 
     @ApiOperation("保存或更新咨询评价")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerConsultationReview> saveOrUpdate(@RequestBody LawyerConsultationReview consultationReview) {
         log.info("LawyerConsultationReviewController.saveOrUpdate?consultationReview={}", consultationReview);
@@ -109,5 +64,52 @@ public class LawyerConsultationReviewController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "rating", value = "评分, 1-5星", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerConsultationReview>> getList(@ModelAttribute LawyerConsultationReview consultationReview) {
+        log.info("LawyerConsultationReviewController.getList?consultationReview={}", consultationReview);
+        List<LawyerConsultationReview> list = QueryBuilder.of(consultationReview)
+                .build()
+                .list(consultationReviewService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "rating", value = "评分, 1-5星", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerConsultationReview>> getPage(@ModelAttribute LawyerConsultationReview consultationReview,
+                                                       @RequestParam(defaultValue = "1") int page,
+                                                       @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerConsultationReviewController.getPage?consultationReview={},page={},size={}", consultationReview, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerConsultationReview> pageResult = QueryBuilder.of(consultationReview)
+                .page(pageNum, pageSize)
+                .build()
+                .page(consultationReviewService);
+        return R.data(pageResult);
+    }
 }
 

+ 52 - 62
alien-store/src/main/java/shop/alien/store/controller/LawyerLegalProblemScenarioController.java

@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerLegalProblemScenario;
 import shop.alien.store.service.LawyerLegalProblemScenarioService;
-import shop.alien.util.LambdaQueryHelper.QueryBuilder;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -29,62 +29,8 @@ public class LawyerLegalProblemScenarioController {
 
     private final LawyerLegalProblemScenarioService lawyerLegalProblemScenarioService;
 
-    @ApiOperation("获取所有法律问题场景")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerLegalProblemScenario>> getAll() {
-        log.info("LawyerLegalProblemScenarioController.getAll");
-        return R.data(lawyerLegalProblemScenarioService.list());
-    }
-
-    @ApiOperation("根据id获取法律问题场景")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerLegalProblemScenario> getOne(Integer id) {
-        log.info("LawyerLegalProblemScenarioController.getOne?id={}", id);
-        return R.data(lawyerLegalProblemScenarioService.getById(id));
-    }
-
-    @ApiOperation("分页查询法律问题场景列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "code", value = "编号", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getLawyerLegalProblemScenarList")
-    public R<IPage<LawyerLegalProblemScenario>> getLawyerLegalProblemScenarList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                                @RequestParam(defaultValue = "10") int pageSize,
-                                                                                @RequestParam(required = false) String name,
-                                                                                @RequestParam(required = false) String code,
-                                                                                @RequestParam(required = false) Integer status) {
-        log.info("LawyerLegalProblemScenarioController.getLawyerLegalProblemScenarList?pageNum={},pageSize={},name={},code={},status={}", pageNum, pageSize, name, code, status);
-        return lawyerLegalProblemScenarioService.getLawyerLegalProblemScenarioList(pageNum, pageSize, name, code, status);
-    }
-
-    @ApiOperation("根据父类ID查询子分类列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({@ApiImplicitParam(name = "parentId", value = "父类主键", dataType = "String", paramType = "query")})
-    @GetMapping("/getListByParentId")
-    public R<List<LawyerLegalProblemScenario>> getListByParentId(@RequestParam(required = false) String parentId) {
-        log.info("LawyerLegalProblemScenarioController.getListByParentId?parentId={}", parentId);
-        return R.data(lawyerLegalProblemScenarioService.getListByParentId(parentId));
-    }
-
-    @ApiOperation("根据父类编号查询子分类列表")
-    @ApiOperationSupport(order = 5)
-    @ApiImplicitParams({@ApiImplicitParam(name = "parentCode", value = "父类编号", dataType = "String", paramType = "query")})
-    @GetMapping("/getListByParentCode")
-    public R<List<LawyerLegalProblemScenario>> getListByParentCode(@RequestParam(required = false) String parentCode) {
-        log.info("LawyerLegalProblemScenarioController.getListByParentCode?parentCode={}", parentCode);
-        return R.data(lawyerLegalProblemScenarioService.getListByParentCode(parentCode));
-    }
-
     @ApiOperation("新增法律问题场景")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addLawyerLegalProblemScenar")
     public R<LawyerLegalProblemScenario> addLawyerLegalProblemScenar(@RequestBody LawyerLegalProblemScenario lawyerLegalProblemScenario) {
         log.info("LawyerLegalProblemScenarioController.addLawyerLegalProblemScenar?lawyerLegalProblemScenario={}", lawyerLegalProblemScenario);
@@ -92,7 +38,7 @@ public class LawyerLegalProblemScenarioController {
     }
 
     @ApiOperation("编辑法律问题场景")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editLawyerLegalProblemScenar")
     public R<LawyerLegalProblemScenario> editLawyerLegalProblemScenar(@RequestBody LawyerLegalProblemScenario lawyerLegalProblemScenario) {
         log.info("LawyerLegalProblemScenarioController.editLawyerLegalProblemScenar?lawyerLegalProblemScenario={}", lawyerLegalProblemScenario);
@@ -100,7 +46,7 @@ public class LawyerLegalProblemScenarioController {
     }
 
     @ApiOperation("删除法律问题场景")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteLawyerLegalProblemScenar")
     public R<Boolean> deleteLawyerLegalProblemScenar(@RequestParam(value = "id") Integer id) {
         log.info("LawyerLegalProblemScenarioController.deleteLawyerLegalProblemScenar?id={}", id);
@@ -108,7 +54,7 @@ public class LawyerLegalProblemScenarioController {
     }
 
     @ApiOperation("保存或更新法律问题场景")
-    @ApiOperationSupport(order = 9)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerLegalProblemScenario> saveOrUpdate(@RequestBody LawyerLegalProblemScenario lawyerLegalProblemScenario) {
         log.info("LawyerLegalProblemScenarioController.saveOrUpdate?lawyerLegalProblemScenario={}", lawyerLegalProblemScenario);
@@ -119,12 +65,23 @@ public class LawyerLegalProblemScenarioController {
         return R.fail("操作失败");
     }
 
-    @ApiOperation("通用查询")
-    @ApiOperationSupport(order = 10)
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "code", value = "编号", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "名称(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "level", value = "问题场景层级", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "parentId", value = "父类主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "parentCode", value = "父类编号", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
     @GetMapping("/getList")
     public R<List<LawyerLegalProblemScenario>> getList(@ModelAttribute LawyerLegalProblemScenario lawyerLegalProblemScenario) {
         log.info("LawyerLegalProblemScenarioController.getList?lawyerLegalProblemScenario={}", lawyerLegalProblemScenario);
-        // 使用 QueryBuilder 工具类进行查询,指定 name 字段使用模糊查询
+        // 使用 QueryBuilder 工具类进行列表查询
         List<LawyerLegalProblemScenario> list = QueryBuilder.of(lawyerLegalProblemScenario)
                 .likeFields("name")  // 指定 name 字段使用模糊查询,其他字段使用等值查询
                 .build()
@@ -132,5 +89,38 @@ public class LawyerLegalProblemScenarioController {
         return R.data(list);
     }
 
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "code", value = "编号", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "名称(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "level", value = "问题场景层级", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "parentId", value = "父类主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "parentCode", value = "父类编号", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerLegalProblemScenario>> getPage(@ModelAttribute LawyerLegalProblemScenario lawyerLegalProblemScenario,
+                                                         @RequestParam(defaultValue = "1") int page,
+                                                         @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerLegalProblemScenarioController.getPage?lawyerLegalProblemScenario={},page={},size={}", 
+                lawyerLegalProblemScenario, page, size);
+        // 参数校验(确保大于0)
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        // 使用 QueryBuilder 工具类进行分页查询
+        IPage<LawyerLegalProblemScenario> pageResult = QueryBuilder.of(lawyerLegalProblemScenario)
+                .likeFields("name")  // 指定 name 字段使用模糊查询,其他字段使用等值查询
+                .page(pageNum, pageSize)
+                .build()
+                .page(lawyerLegalProblemScenarioService);
+        return R.data(pageResult);
+    }
+
 }
 

+ 50 - 41
alien-store/src/main/java/shop/alien/store/controller/LawyerPaymentTransactionController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerPaymentTransaction;
 import shop.alien.store.service.LawyerPaymentTransactionService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,45 +29,8 @@ public class LawyerPaymentTransactionController {
 
     private final LawyerPaymentTransactionService paymentTransactionService;
 
-    @ApiOperation("获取所有支付交易")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerPaymentTransaction>> getAll() {
-        log.info("LawyerPaymentTransactionController.getAll");
-        return R.data(paymentTransactionService.list());
-    }
-
-    @ApiOperation("根据id获取支付交易")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerPaymentTransaction> getOne(Integer id) {
-        log.info("LawyerPaymentTransactionController.getOne?id={}", id);
-        return R.data(paymentTransactionService.getById(id));
-    }
-
-    @ApiOperation("分页查询支付交易列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "transactionStatus", value = "交易状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getPaymentTransactionList")
-    public R<IPage<LawyerPaymentTransaction>> getPaymentTransactionList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                   @RequestParam(defaultValue = "10") int pageSize,
-                                                                   @RequestParam(required = false) Integer consultationOrderId,
-                                                                   @RequestParam(required = false) Integer clientUserId,
-                                                                   @RequestParam(required = false) Integer transactionStatus) {
-        log.info("LawyerPaymentTransactionController.getPaymentTransactionList?pageNum={},pageSize={},consultationOrderId={},clientUserId={},transactionStatus={}",
-                pageNum, pageSize, consultationOrderId, clientUserId, transactionStatus);
-        return paymentTransactionService.getPaymentTransactionList(pageNum, pageSize, consultationOrderId, clientUserId, transactionStatus);
-    }
-
     @ApiOperation("新增支付交易")
-    @ApiOperationSupport(order = 4)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addPaymentTransaction")
     public R<LawyerPaymentTransaction> addPaymentTransaction(@RequestBody LawyerPaymentTransaction paymentTransaction) {
         log.info("LawyerPaymentTransactionController.addPaymentTransaction?paymentTransaction={}", paymentTransaction);
@@ -74,7 +38,7 @@ public class LawyerPaymentTransactionController {
     }
 
     @ApiOperation("编辑支付交易")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editPaymentTransaction")
     public R<LawyerPaymentTransaction> editPaymentTransaction(@RequestBody LawyerPaymentTransaction paymentTransaction) {
         log.info("LawyerPaymentTransactionController.editPaymentTransaction?paymentTransaction={}", paymentTransaction);
@@ -82,7 +46,7 @@ public class LawyerPaymentTransactionController {
     }
 
     @ApiOperation("删除支付交易")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deletePaymentTransaction")
     public R<Boolean> deletePaymentTransaction(@RequestParam(value = "id") Integer id) {
         log.info("LawyerPaymentTransactionController.deletePaymentTransaction?id={}", id);
@@ -90,7 +54,7 @@ public class LawyerPaymentTransactionController {
     }
 
     @ApiOperation("保存或更新支付交易")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerPaymentTransaction> saveOrUpdate(@RequestBody LawyerPaymentTransaction paymentTransaction) {
         log.info("LawyerPaymentTransactionController.saveOrUpdate?paymentTransaction={}", paymentTransaction);
@@ -100,5 +64,50 @@ public class LawyerPaymentTransactionController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "transactionStatus", value = "交易状态", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerPaymentTransaction>> getList(@ModelAttribute LawyerPaymentTransaction paymentTransaction) {
+        log.info("LawyerPaymentTransactionController.getList?paymentTransaction={}", paymentTransaction);
+        List<LawyerPaymentTransaction> list = QueryBuilder.of(paymentTransaction)
+                .build()
+                .list(paymentTransactionService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "consultationOrderId", value = "咨询订单ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "transactionStatus", value = "交易状态", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerPaymentTransaction>> getPage(@ModelAttribute LawyerPaymentTransaction paymentTransaction,
+                                                      @RequestParam(defaultValue = "1") int page,
+                                                      @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerPaymentTransactionController.getPage?paymentTransaction={},page={},size={}", paymentTransaction, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerPaymentTransaction> pageResult = QueryBuilder.of(paymentTransaction)
+                .page(pageNum, pageSize)
+                .build()
+                .page(paymentTransactionService);
+        return R.data(pageResult);
+    }
 }
 

+ 50 - 50
alien-store/src/main/java/shop/alien/store/controller/LawyerServiceAreaController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerServiceArea;
 import shop.alien.store.service.LawyerServiceAreaService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,54 +29,8 @@ public class LawyerServiceAreaController {
 
     private final LawyerServiceAreaService lawyerServiceAreaService;
 
-    @ApiOperation("获取所有律师服务领域关联")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerServiceArea>> getAll() {
-        log.info("LawyerServiceAreaController.getAll");
-        return R.data(lawyerServiceAreaService.list());
-    }
-
-    @ApiOperation("根据id获取律师服务领域关联")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerServiceArea> getOne(Integer id) {
-        log.info("LawyerServiceAreaController.getOne?id={}", id);
-        return R.data(lawyerServiceAreaService.getById(id));
-    }
-
-    @ApiOperation("根据律师ID查询服务领域列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getListByLawyerId")
-    public R<List<LawyerServiceArea>> getListByLawyerId(Integer lawyerUserId) {
-        log.info("LawyerServiceAreaController.getListByLawyerId?lawyerUserId={}", lawyerUserId);
-        return R.data(lawyerServiceAreaService.getListByLawyerId(lawyerUserId));
-    }
-
-    @ApiOperation("分页查询律师服务领域列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getLawyerServiceAreaList")
-    public R<IPage<LawyerServiceArea>> getLawyerServiceAreaList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                  @RequestParam(defaultValue = "10") int pageSize,
-                                                                  @RequestParam(required = false) Integer lawyerUserId,
-                                                                  @RequestParam(required = false) Integer problemScenarId,
-                                                                  @RequestParam(required = false) Integer status) {
-        log.info("LawyerServiceAreaController.getLawyerServiceAreaList?pageNum={},pageSize={},lawyerUserId={},problemScenarId={},status={}",
-                pageNum, pageSize, lawyerUserId, problemScenarId, status);
-        return lawyerServiceAreaService.getLawyerServiceAreaList(pageNum, pageSize, lawyerUserId, problemScenarId, status);
-    }
-
     @ApiOperation("新增律师服务领域")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addLawyerServiceArea")
     public R<LawyerServiceArea> addLawyerServiceArea(@RequestBody LawyerServiceArea lawyerServiceArea) {
         log.info("LawyerServiceAreaController.addLawyerServiceArea?lawyerServiceArea={}", lawyerServiceArea);
@@ -83,7 +38,7 @@ public class LawyerServiceAreaController {
     }
 
     @ApiOperation("编辑律师服务领域")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editLawyerServiceArea")
     public R<LawyerServiceArea> editLawyerServiceArea(@RequestBody LawyerServiceArea lawyerServiceArea) {
         log.info("LawyerServiceAreaController.editLawyerServiceArea?lawyerServiceArea={}", lawyerServiceArea);
@@ -91,7 +46,7 @@ public class LawyerServiceAreaController {
     }
 
     @ApiOperation("删除律师服务领域")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteLawyerServiceArea")
     public R<Boolean> deleteLawyerServiceArea(@RequestParam(value = "id") Integer id) {
         log.info("LawyerServiceAreaController.deleteLawyerServiceArea?id={}", id);
@@ -99,7 +54,7 @@ public class LawyerServiceAreaController {
     }
 
     @ApiOperation("保存或更新律师服务领域")
-    @ApiOperationSupport(order = 8)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerServiceArea> saveOrUpdate(@RequestBody LawyerServiceArea lawyerServiceArea) {
         log.info("LawyerServiceAreaController.saveOrUpdate?lawyerServiceArea={}", lawyerServiceArea);
@@ -109,5 +64,50 @@ public class LawyerServiceAreaController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerServiceArea>> getList(@ModelAttribute LawyerServiceArea lawyerServiceArea) {
+        log.info("LawyerServiceAreaController.getList?lawyerServiceArea={}", lawyerServiceArea);
+        List<LawyerServiceArea> list = QueryBuilder.of(lawyerServiceArea)
+                .build()
+                .list(lawyerServiceAreaService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "lawyerUserId", value = "律师用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "problemScenarId", value = "法律问题场景ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerServiceArea>> getPage(@ModelAttribute LawyerServiceArea lawyerServiceArea,
+                                               @RequestParam(defaultValue = "1") int page,
+                                               @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerServiceAreaController.getPage?lawyerServiceArea={},page={},size={}", lawyerServiceArea, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerServiceArea> pageResult = QueryBuilder.of(lawyerServiceArea)
+                .page(pageNum, pageSize)
+                .build()
+                .page(lawyerServiceAreaService);
+        return R.data(pageResult);
+    }
 }
 

+ 56 - 40
alien-store/src/main/java/shop/alien/store/controller/LawyerUserController.java

@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerUser;
 import shop.alien.store.service.LawyerUserService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
+
+import java.util.List;
 
 /**
  * 律师用户 前端控制器
@@ -26,44 +29,8 @@ public class LawyerUserController {
 
     private final LawyerUserService lawyerUserService;
 
-    @ApiOperation("获取所有律师用户")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<java.util.List<LawyerUser>> getAll() {
-        log.info("LawyerUserController.getAll");
-        return R.data(lawyerUserService.list());
-    }
-
-    @ApiOperation("根据id获取律师用户")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerUser> getOne(Integer id) {
-        log.info("LawyerUserController.getOne?id={}", id);
-        return R.data(lawyerUserService.getById(id));
-    }
-
-    @ApiOperation("分页查询律师用户列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "name", value = "姓名", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query"),
-            @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getLawyerUserList")
-    public R<IPage<LawyerUser>> getLawyerUserList(@RequestParam(defaultValue = "1") int pageNum,
-                                                    @RequestParam(defaultValue = "10") int pageSize,
-                                                    @RequestParam(required = false) String name,
-                                                    @RequestParam(required = false) String phone,
-                                                    @RequestParam(required = false) Integer status) {
-        log.info("LawyerUserController.getLawyerUserList?pageNum={},pageSize={},name={},phone={},status={}", pageNum, pageSize, name, phone, status);
-        return lawyerUserService.getLawyerUserList(pageNum, pageSize, name, phone, status);
-    }
-
     @ApiOperation("新增律师用户")
-    @ApiOperationSupport(order = 4)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addLawyerUser")
     public R<LawyerUser> addLawyerUser(@RequestBody LawyerUser lawyerUser) {
         log.info("LawyerUserController.addLawyerUser?lawyerUser={}", lawyerUser);
@@ -71,7 +38,7 @@ public class LawyerUserController {
     }
 
     @ApiOperation("编辑律师用户")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 2)
     @PostMapping("/editLawyerUser")
     public R<LawyerUser> editLawyerUser(@RequestBody LawyerUser lawyerUser) {
         log.info("LawyerUserController.editLawyerUser?lawyerUser={}", lawyerUser);
@@ -79,7 +46,7 @@ public class LawyerUserController {
     }
 
     @ApiOperation("删除律师用户")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/deleteLawyerUser")
     public R<Boolean> deleteLawyerUser(@RequestParam(value = "id") Integer id) {
         log.info("LawyerUserController.deleteLawyerUser?id={}", id);
@@ -87,7 +54,7 @@ public class LawyerUserController {
     }
 
     @ApiOperation("保存或更新律师用户")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 4)
     @PostMapping("/saveOrUpdate")
     public R<LawyerUser> saveOrUpdate(@RequestBody LawyerUser lawyerUser) {
         log.info("LawyerUserController.saveOrUpdate?lawyerUser={}", lawyerUser);
@@ -97,5 +64,54 @@ public class LawyerUserController {
         }
         return R.fail("操作失败");
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "姓名(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "phone", value = "手机号(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "用户状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "certificationStatus", value = "资质认证状态, 0:未认证, 1:认证中, 2:已认证, 3:认证失败", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerUser>> getList(@ModelAttribute LawyerUser lawyerUser) {
+        log.info("LawyerUserController.getList?lawyerUser={}", lawyerUser);
+        List<LawyerUser> list = QueryBuilder.of(lawyerUser)
+                .likeFields("name", "phone")  // 姓名和手机号支持模糊查询
+                .build()
+                .list(lawyerUserService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 6)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "name", value = "姓名(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "phone", value = "手机号(支持模糊查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "status", value = "用户状态, 0:禁用, 1:启用", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "certificationStatus", value = "资质认证状态, 0:未认证, 1:认证中, 2:已认证, 3:认证失败", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerUser>> getPage(@ModelAttribute LawyerUser lawyerUser,
+                                         @RequestParam(defaultValue = "1") int page,
+                                         @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerUserController.getPage?lawyerUser={},page={},size={}", lawyerUser, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerUser> pageResult = QueryBuilder.of(lawyerUser)
+                .likeFields("name", "phone")  // 姓名和手机号支持模糊查询
+                .page(pageNum, pageSize)
+                .build()
+                .page(lawyerUserService);
+        return R.data(pageResult);
+    }
 }
 

+ 47 - 47
alien-store/src/main/java/shop/alien/store/controller/LawyerUserSearchHistoryController.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerUserSearchHistory;
 import shop.alien.store.service.LawyerUserSearchHistoryService;
+import shop.alien.util.myBaticsPlus.QueryBuilder;
 
 import java.util.List;
 
@@ -28,52 +29,8 @@ public class LawyerUserSearchHistoryController {
 
     private final LawyerUserSearchHistoryService userSearchHistoryService;
 
-    @ApiOperation("获取所有用户搜索历史")
-    @ApiOperationSupport(order = 1)
-    @GetMapping("/getAll")
-    public R<List<LawyerUserSearchHistory>> getAll() {
-        log.info("LawyerUserSearchHistoryController.getAll");
-        return R.data(userSearchHistoryService.list());
-    }
-
-    @ApiOperation("根据id获取用户搜索历史")
-    @ApiOperationSupport(order = 2)
-    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getOne")
-    public R<LawyerUserSearchHistory> getOne(Integer id) {
-        log.info("LawyerUserSearchHistoryController.getOne?id={}", id);
-        return R.data(userSearchHistoryService.getById(id));
-    }
-
-    @ApiOperation("根据用户ID查询搜索历史列表")
-    @ApiOperationSupport(order = 3)
-    @ApiImplicitParams({@ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query", required = true)})
-    @GetMapping("/getListByUserId")
-    public R<List<LawyerUserSearchHistory>> getListByUserId(Integer clientUserId) {
-        log.info("LawyerUserSearchHistoryController.getListByUserId?clientUserId={}", clientUserId);
-        return R.data(userSearchHistoryService.getListByUserId(clientUserId));
-    }
-
-    @ApiOperation("分页查询用户搜索历史列表")
-    @ApiOperationSupport(order = 4)
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
-            @ApiImplicitParam(name = "searchType", value = "搜索类型", dataType = "Integer", paramType = "query")
-    })
-    @GetMapping("/getUserSearchHistoryList")
-    public R<IPage<LawyerUserSearchHistory>> getUserSearchHistoryList(@RequestParam(defaultValue = "1") int pageNum,
-                                                                 @RequestParam(defaultValue = "10") int pageSize,
-                                                                 @RequestParam(required = false) Integer clientUserId,
-                                                                 @RequestParam(required = false) Integer searchType) {
-        log.info("LawyerUserSearchHistoryController.getUserSearchHistoryList?pageNum={},pageSize={},clientUserId={},searchType={}",
-                pageNum, pageSize, clientUserId, searchType);
-        return userSearchHistoryService.getUserSearchHistoryList(pageNum, pageSize, clientUserId, searchType);
-    }
-
     @ApiOperation("新增用户搜索历史")
-    @ApiOperationSupport(order = 5)
+    @ApiOperationSupport(order = 1)
     @PostMapping("/addUserSearchHistory")
     public R<LawyerUserSearchHistory> addUserSearchHistory(@RequestBody LawyerUserSearchHistory userSearchHistory) {
         log.info("LawyerUserSearchHistoryController.addUserSearchHistory?userSearchHistory={}", userSearchHistory);
@@ -81,7 +38,7 @@ public class LawyerUserSearchHistoryController {
     }
 
     @ApiOperation("删除用户搜索历史")
-    @ApiOperationSupport(order = 6)
+    @ApiOperationSupport(order = 2)
     @DeleteMapping("/deleteUserSearchHistory")
     public R<Boolean> deleteUserSearchHistory(@RequestParam(value = "id") Integer id) {
         log.info("LawyerUserSearchHistoryController.deleteUserSearchHistory?id={}", id);
@@ -89,11 +46,54 @@ public class LawyerUserSearchHistoryController {
     }
 
     @ApiOperation("清空用户搜索历史")
-    @ApiOperationSupport(order = 7)
+    @ApiOperationSupport(order = 3)
     @DeleteMapping("/clearUserSearchHistory")
     public R<Boolean> clearUserSearchHistory(@RequestParam(value = "clientUserId") Integer clientUserId) {
         log.info("LawyerUserSearchHistoryController.clearUserSearchHistory?clientUserId={}", clientUserId);
         return userSearchHistoryService.clearUserSearchHistory(clientUserId);
     }
+
+    @ApiOperation("通用列表查询")
+    @ApiOperationSupport(order = 4)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "searchType", value = "搜索类型", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getList")
+    public R<List<LawyerUserSearchHistory>> getList(@ModelAttribute LawyerUserSearchHistory userSearchHistory) {
+        log.info("LawyerUserSearchHistoryController.getList?userSearchHistory={}", userSearchHistory);
+        List<LawyerUserSearchHistory> list = QueryBuilder.of(userSearchHistory)
+                .build()
+                .list(userSearchHistoryService);
+        return R.data(list);
+    }
+
+    @ApiOperation("通用分页查询")
+    @ApiOperationSupport(order = 5)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "page", value = "页数(默认1)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "页容(默认10)", dataType = "int", paramType = "query"),
+            @ApiImplicitParam(name = "id", value = "主键", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "clientUserId", value = "客户端用户ID", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "searchType", value = "搜索类型", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_Start", value = "创建时间开始(范围查询)", dataType = "String", paramType = "query"),
+            @ApiImplicitParam(name = "createdTime_End", value = "创建时间结束(范围查询)", dataType = "String", paramType = "query")
+    })
+    @GetMapping("/getPage")
+    public R<IPage<LawyerUserSearchHistory>> getPage(@ModelAttribute LawyerUserSearchHistory userSearchHistory,
+                                                     @RequestParam(defaultValue = "1") int page,
+                                                     @RequestParam(defaultValue = "10") int size) {
+        log.info("LawyerUserSearchHistoryController.getPage?userSearchHistory={},page={},size={}", userSearchHistory, page, size);
+        int pageNum = page > 0 ? page : 1;
+        int pageSize = size > 0 ? size : 10;
+        IPage<LawyerUserSearchHistory> pageResult = QueryBuilder.of(userSearchHistory)
+                .page(pageNum, pageSize)
+                .build()
+                .page(userSearchHistoryService);
+        return R.data(pageResult);
+    }
 }
 

+ 0 - 31
alien-store/src/main/java/shop/alien/store/service/LawyerLegalProblemScenarioService.java

@@ -16,34 +16,6 @@ import java.util.List;
 public interface LawyerLegalProblemScenarioService extends IService<LawyerLegalProblemScenario> {
 
     /**
-     * 分页查询法律问题场景列表
-     *
-     * @param pageNum  页码
-     * @param pageSize 页容
-     * @param name     名称
-     * @param code     编号
-     * @param status   状态
-     * @return IPage<LawyerLegalProblemScenar>
-     */
-    R<IPage<LawyerLegalProblemScenario>> getLawyerLegalProblemScenarioList(int pageNum, int pageSize, String name, String code, Integer status);
-
-    /**
-     * 根据父类ID查询子分类列表
-     *
-     * @param parentId 父类主键
-     * @return List<LawyerLegalProblemScenar>
-     */
-    List<LawyerLegalProblemScenario> getListByParentId(String parentId);
-
-    /**
-     * 根据父类编号查询子分类列表
-     *
-     * @param parentCode 父类编号
-     * @return List<LawyerLegalProblemScenar>
-     */
-    List<LawyerLegalProblemScenario> getListByParentCode(String parentCode);
-
-    /**
      * 新增法律问题场景
      *
      * @param lawyerLegalProblemScenario 法律问题场景
@@ -66,8 +38,5 @@ public interface LawyerLegalProblemScenarioService extends IService<LawyerLegalP
      * @return R<Boolean>
      */
     R<Boolean> deleteLawyerLegalProblemScenario(Integer id);
-
-
-    List<LawyerLegalProblemScenario> getListByLawyerLegalProblemScenario(LawyerLegalProblemScenario lawyerLegalProblemScenario);
 }
 

+ 0 - 21
alien-store/src/main/java/shop/alien/store/service/LawyerServiceAreaService.java

@@ -16,27 +16,6 @@ import java.util.List;
 public interface LawyerServiceAreaService extends IService<LawyerServiceArea> {
 
     /**
-     * 分页查询律师服务领域列表
-     *
-     * @param pageNum       页码
-     * @param pageSize      页容
-     * @param lawyerUserId  律师用户ID
-     * @param problemScenarId 法律问题场景ID
-     * @param status        状态
-     * @return IPage<LawyerServiceArea>
-     */
-    R<IPage<LawyerServiceArea>> getLawyerServiceAreaList(int pageNum, int pageSize, Integer lawyerUserId,
-                                                         Integer problemScenarId, Integer status);
-
-    /**
-     * 根据律师ID查询服务领域列表
-     *
-     * @param lawyerUserId 律师用户ID
-     * @return List<LawyerServiceArea>
-     */
-    List<LawyerServiceArea> getListByLawyerId(Integer lawyerUserId);
-
-    /**
      * 新增律师服务领域
      *
      * @param lawyerServiceArea 律师服务领域关联

+ 0 - 63
alien-store/src/main/java/shop/alien/store/service/impl/LawyerLegalProblemScenarioServiceImpl.java

@@ -1,22 +1,16 @@
 package shop.alien.store.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
 import shop.alien.entity.result.R;
 import shop.alien.entity.store.LawyerLegalProblemScenario;
 import shop.alien.mapper.LawyerLegalProblemScenarioMapper;
 import shop.alien.store.service.LawyerLegalProblemScenarioService;
 
-import java.util.Collections;
-import java.util.List;
-
 /**
  * 法律问题场景 服务实现类
  *
@@ -29,58 +23,6 @@ import java.util.List;
 @RequiredArgsConstructor
 public class LawyerLegalProblemScenarioServiceImpl extends ServiceImpl<LawyerLegalProblemScenarioMapper, LawyerLegalProblemScenario> implements LawyerLegalProblemScenarioService {
 
-    private final LawyerLegalProblemScenarioMapper lawyerLegalProblemScenarioMapper;
-
-    @Override
-    public R<IPage<LawyerLegalProblemScenario>> getLawyerLegalProblemScenarioList(int pageNum, int pageSize, String name, String code, Integer status) {
-        log.info("LawyerLegalProblemScenarioServiceImpl.getLawyerLegalProblemScenarioList?pageNum={},pageSize={},name={},code={},status={}", pageNum, pageSize, name, code, status);
-        Page<LawyerLegalProblemScenario> page = new Page<>(pageNum, pageSize);
-        LambdaQueryWrapper<LawyerLegalProblemScenario> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LawyerLegalProblemScenario::getDeleteFlag, 0);
-        if (StringUtils.hasText(name)) {
-            queryWrapper.like(LawyerLegalProblemScenario::getName, name);
-        }
-        if (StringUtils.hasText(code)) {
-            queryWrapper.eq(LawyerLegalProblemScenario::getCode, code);
-        }
-        if (status != null) {
-            queryWrapper.eq(LawyerLegalProblemScenario::getStatus, status);
-        }
-        queryWrapper.orderByAsc(LawyerLegalProblemScenario::getSortOrder);
-        IPage<LawyerLegalProblemScenario> pageResult = this.page(page, queryWrapper);
-        return R.data(pageResult);
-    }
-
-    @Override
-    public List<LawyerLegalProblemScenario> getListByParentId(String parentId) {
-        log.info("LawyerLegalProblemScenarioServiceImpl.getListByParentId?parentId={}", parentId);
-        LambdaQueryWrapper<LawyerLegalProblemScenario> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LawyerLegalProblemScenario::getDeleteFlag, 0);
-        queryWrapper.eq(LawyerLegalProblemScenario::getStatus, 1);
-        if (parentId == null) {
-            queryWrapper.isNull(LawyerLegalProblemScenario::getParentId);
-        } else {
-            queryWrapper.eq(LawyerLegalProblemScenario::getParentId, parentId);
-        }
-        queryWrapper.orderByAsc(LawyerLegalProblemScenario::getSortOrder);
-        return this.list(queryWrapper);
-    }
-
-    @Override
-    public List<LawyerLegalProblemScenario> getListByParentCode(String parentCode) {
-        log.info("LawyerLegalProblemScenarioServiceImpl.getListByParentCode?parentCode={}", parentCode);
-        LambdaQueryWrapper<LawyerLegalProblemScenario> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LawyerLegalProblemScenario::getDeleteFlag, 0);
-        queryWrapper.eq(LawyerLegalProblemScenario::getStatus, 1);
-        if (parentCode == null) {
-            queryWrapper.isNull(LawyerLegalProblemScenario::getParentCode);
-        } else {
-            queryWrapper.eq(LawyerLegalProblemScenario::getParentCode, parentCode);
-        }
-        queryWrapper.orderByAsc(LawyerLegalProblemScenario::getSortOrder);
-        return this.list(queryWrapper);
-    }
-
     @Override
     public R<LawyerLegalProblemScenario> addLawyerLegalProblemScenario(LawyerLegalProblemScenario LawyerLegalProblemScenario) {
         log.info("LawyerLegalProblemScenarioServiceImpl.addLawyerLegalProblemScenario?LawyerLegalProblemScenario={}", LawyerLegalProblemScenario);
@@ -111,10 +53,5 @@ public class LawyerLegalProblemScenarioServiceImpl extends ServiceImpl<LawyerLeg
         return R.fail("删除失败");
     }
 
-    @Override
-    public List<LawyerLegalProblemScenario> getListByLawyerLegalProblemScenario(LawyerLegalProblemScenario lawyerLegalProblemScenario) {
-        return lawyerLegalProblemScenarioMapper.selectList(null);
-    }
-
 }
 

+ 0 - 40
alien-store/src/main/java/shop/alien/store/service/impl/LawyerServiceAreaServiceImpl.java

@@ -1,8 +1,5 @@
 package shop.alien.store.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -13,8 +10,6 @@ import shop.alien.entity.store.LawyerServiceArea;
 import shop.alien.mapper.LawyerServiceAreaMapper;
 import shop.alien.store.service.LawyerServiceAreaService;
 
-import java.util.List;
-
 /**
  * 律师服务领域关联 服务实现类
  *
@@ -27,41 +22,6 @@ import java.util.List;
 @RequiredArgsConstructor
 public class LawyerServiceAreaServiceImpl extends ServiceImpl<LawyerServiceAreaMapper, LawyerServiceArea> implements LawyerServiceAreaService {
 
-    private final LawyerServiceAreaMapper lawyerServiceAreaMapper;
-
-    @Override
-    public R<IPage<LawyerServiceArea>> getLawyerServiceAreaList(int pageNum, int pageSize, Integer lawyerUserId,
-                                                                 Integer problemScenarId, Integer status) {
-        log.info("LawyerServiceAreaServiceImpl.getLawyerServiceAreaList?pageNum={},pageSize={},lawyerUserId={},problemScenarId={},status={}",
-                pageNum, pageSize, lawyerUserId, problemScenarId, status);
-        Page<LawyerServiceArea> page = new Page<>(pageNum, pageSize);
-        LambdaQueryWrapper<LawyerServiceArea> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LawyerServiceArea::getDeleteFlag, 0);
-        if (lawyerUserId != null) {
-            queryWrapper.eq(LawyerServiceArea::getLawyerUserId, lawyerUserId);
-        }
-        if (problemScenarId != null) {
-            queryWrapper.eq(LawyerServiceArea::getProblemScenarId, problemScenarId);
-        }
-        if (status != null) {
-            queryWrapper.eq(LawyerServiceArea::getStatus, status);
-        }
-        queryWrapper.orderByAsc(LawyerServiceArea::getSortOrder);
-        IPage<LawyerServiceArea> pageResult = this.page(page, queryWrapper);
-        return R.data(pageResult);
-    }
-
-    @Override
-    public List<LawyerServiceArea> getListByLawyerId(Integer lawyerUserId) {
-        log.info("LawyerServiceAreaServiceImpl.getListByLawyerId?lawyerUserId={}", lawyerUserId);
-        LambdaQueryWrapper<LawyerServiceArea> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(LawyerServiceArea::getLawyerUserId, lawyerUserId)
-                .eq(LawyerServiceArea::getDeleteFlag, 0)
-                .eq(LawyerServiceArea::getStatus, 1)
-                .orderByAsc(LawyerServiceArea::getSortOrder);
-        return this.list(queryWrapper);
-    }
-
     @Override
     public R<LawyerServiceArea> addLawyerServiceArea(LawyerServiceArea lawyerServiceArea) {
         log.info("LawyerServiceAreaServiceImpl.addLawyerServiceArea?lawyerServiceArea={}", lawyerServiceArea);

+ 33 - 14
alien-util/src/main/java/shop/alien/util/LambdaQueryHelper/QueryBuilder.java → alien-util/src/main/java/shop/alien/util/myBaticsPlus/QueryBuilder.java

@@ -1,4 +1,4 @@
-package shop.alien.util.LambdaQueryHelper;
+package shop.alien.util.myBaticsPlus;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -27,13 +27,13 @@ import java.util.List;
  * // 2. 分页查询
  * QueryBuilder.of(query).page(1, 10).build().page(service);
  * 
- * // 3. 批量查询(字段名以List结尾,如:idList)
+ * // 3. 批量查询(字段名以_List结尾,如:id_List)
  * QueryBuilder.of(query).build().list(service);
  * 
- * // 4. 范围查询(字段名以Start/End结尾,如:createdTimeStart, createdTimeEnd)
+ * // 4. 范围查询(字段名以_Start/_End结尾,如:createdTime_Start, createdTime_End)
  * QueryBuilder.of(query).build().list(service);
  * 
- * // 5. 模糊查询(字段名以Like结尾,如:nameLike)
+ * // 5. 模糊查询(字段名以_Like结尾,如:name_Like)
  * QueryBuilder.of(query).build().list(service);
  * }</pre>
  *
@@ -44,11 +44,11 @@ public class QueryBuilder<T> {
 
     // ==================== 常量定义 ====================
     
-    /** 特殊查询字段后缀 */
-    private static final String SUFFIX_LIST = "List";
-    private static final String SUFFIX_START = "Start";
-    private static final String SUFFIX_END = "End";
-    private static final String SUFFIX_LIKE = "Like";
+    /** 特殊查询字段后缀(统一使用下划线前缀,避免与普通字段冲突) */
+    private static final String SUFFIX_LIST = "_List";
+    private static final String SUFFIX_START = "_Start";
+    private static final String SUFFIX_END = "_End";
+    private static final String SUFFIX_LIKE = "_Like";
     
     /** 模糊查询通配符 */
     private static final String LIKE_WILDCARD = "%";
@@ -280,7 +280,7 @@ public class QueryBuilder<T> {
     }
 
     /**
-     * 判断是否为特殊查询字段(List/Start/End/Like后缀)
+     * 判断是否为特殊查询字段(_List/_Start/_End/_Like后缀)
      */
     private boolean isSpecialQueryField(String fieldName) {
         return fieldName.endsWith(SUFFIX_LIST) ||
@@ -427,14 +427,33 @@ public class QueryBuilder<T> {
     }
 
     /**
-     * 移除字段名后缀
+     * 移除字段名后缀(精确实现:只移除末尾的后缀)
+     * 
+     * 示例:
+     * - removeSuffix("id_List", "_List") → "id"
+     * - removeSuffix("createdTime_Start", "_Start") → "createdTime"
+     * - removeSuffix("name_Like", "_Like") → "name"
+     * - removeSuffix("id_List_List", "_List") → "id_List"(只移除末尾的)
+     * 
+     * @param fieldName 字段名
+     * @param suffixes 要移除的后缀(按顺序尝试,找到第一个匹配的就移除)
+     * @return 移除后缀后的字段名
      */
     private String removeSuffix(String fieldName, String... suffixes) {
-        String result = fieldName;
+        if (fieldName == null || fieldName.isEmpty()) {
+            return fieldName;
+        }
+        
+        // 按顺序尝试每个后缀,找到第一个匹配的就移除
         for (String suffix : suffixes) {
-            result = result.replace(suffix, "");
+            if (suffix != null && !suffix.isEmpty() && fieldName.endsWith(suffix)) {
+                // 只移除末尾的后缀,使用 substring 精确移除
+                return fieldName.substring(0, fieldName.length() - suffix.length());
+            }
         }
-        return result;
+        
+        // 如果没有匹配的后缀,返回原字段名
+        return fieldName;
     }
 
     /**