Pārlūkot izejas kodu

订单列表,学生列表 新增学校名称字段返回

zouxuan 5 gadi atpakaļ
vecāks
revīzija
5efc28198c

+ 2 - 2
src/main/java/com/ym/mec/collectfee/controller/OrderController.java

@@ -34,8 +34,8 @@ public class OrderController extends BaseController {
     @PostMapping("/checkOrderList")
 //  @ApiOperation(value = "根据学生编号,获取订单列表")
 //  @ApiImplicitParams({ @ApiImplicitParam(name = "classId", value = "乐团编号", required = true, dataType = "Integer")})
-	  public Object checkOrders(Integer classId, Integer type, String voicyPart, String startTime, String endTime){
-	      return succeed(orderService.getOrderByClassId(classId,type,voicyPart,startTime,endTime));
+	  public Object checkOrders(Integer classId, Integer type, String voicyPart, String startTime, String endTime, Integer branchId){
+	      return succeed(orderService.getOrderByClassId(classId,type,voicyPart,startTime,endTime,branchId));
 	  }
 
     /**

+ 1 - 1
src/main/java/com/ym/mec/collectfee/dao/OrderDao.java

@@ -14,7 +14,7 @@ public interface OrderDao extends BaseDAO<Integer, Order> {
 
     List<Order> getOrderByUserId(Integer userId);
 
-    List<Order> getOrderByClassId(@Param("classId") Integer classId,@Param("type") Integer type, @Param("voicyPart")String voicyPart, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    List<Order> getOrderByClassId(@Param("classId") Integer classId,@Param("type") Integer type, @Param("voicyPart")String voicyPart, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("branchId") Integer branchId);
 
     List<Order> getOrderByBatch(String batchNum);
 

+ 10 - 0
src/main/java/com/ym/mec/collectfee/entity/ApplyInfoPage.java

@@ -8,6 +8,16 @@ public class ApplyInfoPage extends ApplyInfo {
 
     private String subName;
 
+    private String schoolName;
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
     public BigDecimal getAmount() {
         return amount;
     }

+ 1 - 1
src/main/java/com/ym/mec/collectfee/service/OrderService.java

@@ -28,7 +28,7 @@ public interface OrderService extends BaseService<Integer, Order> {
      * @param userId
      * @return
      */
-    List<Order> getOrderByClassId(Integer classId, Integer type, String voicyPart,String startTime,String endTime);
+    List<Order> getOrderByClassId(Integer classId, Integer type, String voicyPart,String startTime,String endTime, Integer branchId);
 
 
     /**

+ 2 - 2
src/main/java/com/ym/mec/collectfee/service/impl/OrderServiceImpl.java

@@ -178,8 +178,8 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
     }
 
     @Override
-    public List<Order> getOrderByClassId(Integer classId, Integer type, String voicyPart,String startTime,String endTime) {
-        return orderDao.getOrderByClassId(classId, type, voicyPart,startTime,endTime);
+    public List<Order> getOrderByClassId(Integer classId, Integer type, String voicyPart,String startTime,String endTime, Integer branchId) {
+        return orderDao.getOrderByClassId(classId, type, voicyPart,startTime,endTime,branchId);
     }
 
     public static void main(String[] args) {

+ 3 - 2
src/main/resources/config/mybatis/ApplyInfoMapper.xml

@@ -35,6 +35,7 @@
 		<result column="id_" property="id" />
 		<result column="user_id_" property="userId" />
 		<result column="name_" property="name" />
+		<result column="po_name" property="schoolName" />
 		<result column="sex_" property="sex" />
 		<result column="birthday_" property="birthday" />
 		<result column="city_" property="city" />
@@ -188,8 +189,8 @@
 	</select>
 
 	<select id="queryUserPage" resultMap="ApplyInfoPage" parameterType="map">
-		SELECT ao.*,cgi.sub_name_ sub_name_ FROM (SELECT ai.*,o.amount amount_ FROM apply_info ai
-		LEFT JOIN (SELECT * FROM `order` WHERE id IN (SELECT DISTINCT(user_id) FROM `order` WHERE class_id = #{musicTeamId})) o
+		SELECT ao.*,cgi.sub_name_ sub_name_ FROM (SELECT ai.*,o.amount amount_,o.po_name FROM apply_info ai
+		LEFT JOIN (SELECT * FROM `order` WHERE id IN (SELECT MAX(id) FROM `order` WHERE class_id = #{musicTeamId} GROUP BY user_id)) o
 		ON ai.id_ = o.user_id <include refid="studentsPage"/>) ao
 		LEFT JOIN course_group_info cgi ON ao.course_id_ = cgi.id_
 		ORDER BY ao.update_time_ DESC

+ 3 - 0
src/main/resources/config/mybatis/OrderMapper.xml

@@ -158,6 +158,9 @@
         <if test="type != null">
             and type = #{type}
         </if>
+        <if test="branchId != null">
+            and branch_id = #{branchId}
+        </if>
         <if test="voicyPart != null">
             and voicy_part like '%${voicyPart}%'
         </if>