zhangxin 1 долоо хоног өмнө
parent
commit
16a3aeeeca

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/FindPageCUserInfoResponseDTO.java

@@ -22,6 +22,9 @@ import java.util.Date;
 @Schema(description="C端用户请求入参")
 public class FindPageCUserInfoResponseDTO {
 
+    //用户昵称
+    @Schema(description = "用户id")
+    private String id;
     //用户昵称
     @Schema(description = "用户昵称")
     private String username;

+ 9 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppCoursesMapper.java

@@ -1,11 +1,14 @@
 package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.app.dto.SearchDTO;
 import org.jeecg.modules.app.vo.CourseInfoVO;
 import org.jeecg.modules.app.vo.SearchVO;
+import org.jeecg.modules.app.vo.course.CourseRequestVo;
+import org.jeecg.modules.app.vo.course.CourseResponseVo;
 import org.jeecg.modules.system.app.entity.AppCourses;
 
 /**
@@ -32,4 +35,10 @@ public interface AppCoursesMapper extends BaseMapper<AppCourses> {
      * @return CourseInfoVO {@link CourseInfoVO}
      **/
     CourseInfoVO getCourseInfo(@Param("id")String id);
+
+    IPage<CourseResponseVo> findByCourseList(@Param("page") Page<CourseResponseVo> page,@Param("courseRequestVo") CourseRequestVo courseRequestVo);
+
+    IPage<CourseResponseVo> findByLaLoList(@Param("page") Page<CourseResponseVo> page,@Param("courseRequestVo") CourseRequestVo courseRequestVo);
+
+    IPage<CourseResponseVo> findByList(@Param("page") Page<CourseResponseVo> page,@Param("courseRequestVo") CourseRequestVo courseRequestVo);
 }

+ 13 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppInstructorMapper.java

@@ -5,8 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.app.dto.SearchDTO;
 import org.jeecg.modules.app.vo.SearchVO;
+import org.jeecg.modules.app.vo.coach.AppCoachDetailsVO;
+import org.jeecg.modules.app.vo.coach.AppCoachVO;
 import org.jeecg.modules.system.app.entity.AppInstructor;
 
+import java.util.List;
+
 /**
  * @Description: 教练表
  * @Author: jeecg-boot
@@ -22,4 +26,13 @@ public interface AppInstructorMapper extends BaseMapper<AppInstructor> {
      * @return Page<SearchVO.SearchInstructorVO>
      **/
     Page<SearchVO.SearchInstructorVO> convertSearchInstructorVOPage(@Param("page")Page<SearchVO.SearchInstructorVO> page,@Param("searchDTO")SearchDTO searchDTO);
+
+    /**
+     * 查询所有教练
+     * @return
+     */
+    List<AppCoachVO> findCoachList();
+
+
+    AppCoachDetailsVO findById(@Param("id")String id);
 }

+ 57 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppCoursesMapper.xml

@@ -80,4 +80,61 @@
             instructorName,
             instructorAvatar;
     </select>
+    <select id="findByCourseList" resultType="org.jeecg.modules.app.vo.course.CourseResponseVo">
+        select b.`name`,e.address,b.original_price,b.selling_price
+             ,b.id,b.price_type,b.good_rate,e.latitude,e.longitude,count(c.courses_id) as coursesNum
+        FROM nm_courses b
+        LEFT JOIN nm_courses_price_rules c on b.id= c.courses_id
+        LEFT JOIN nm_site e on e.id = b.site_id
+        where 1=1
+        <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
+            and  b.user_id=#{courseRequestVo.instructorId}
+        </if>
+        <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
+            and  b.site_id=#{courseRequestVo.siteId}
+        </if>
+        <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
+            and  b.site_id=#{courseRequestVo.siteId}
+        </if>
+        GROUP BY b.id
+    </select>
+    <select id="findByLaLoList" resultType="org.jeecg.modules.app.vo.course.CourseResponseVo">
+        select b.`name`,e.address,b.original_price,b.selling_price
+             ,b.id,b.price_type,b.good_rate,e.latitude,e.longitude,count(c.courses_id) as coursesNum,
+               ST_Distance_Sphere(
+                       POINT(#{courseRequestVo.longitude}, #{courseRequestVo.latitude}),
+                       POINT(e.longitude, e.latitude)
+                   ) /1000 AS km
+        FROM nm_courses b
+        LEFT JOIN nm_courses_price_rules c on b.id= c.courses_id
+        LEFT JOIN nm_site e on e.id = b.site_id
+        GROUP BY b.id
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '1'">
+            ORDER BY km DESC
+        </if>
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '2'">
+            ORDER BY b.create_time DESC
+        </if>
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '0'">
+            ORDER BY b.create_time DESC
+        </if>
+    </select>
+    <select id="findByList" resultType="org.jeecg.modules.app.vo.course.CourseResponseVo">
+        select b.`name`,e.address,b.original_price,b.selling_price
+        ,b.id,b.price_type,b.good_rate,e.latitude,e.longitude,count(c.courses_id) as coursesNum
+        FROM nm_courses b
+        LEFT JOIN nm_courses_price_rules c on b.id= c.courses_id
+        LEFT JOIN nm_site e on e.id = b.site_id
+        GROUP BY b.id
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '1'">
+            ORDER BY b.create_time DESC
+        </if>
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '2'">
+            ORDER BY b.create_time DESC
+        </if>
+        <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '0'">
+            ORDER BY b.create_time DESC
+        </if>
+    </select>
+
 </mapper>

+ 29 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppInstructorMapper.xml

@@ -1,6 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppInstructorMapper">
+
+    <resultMap id="appCoachDetailsVOResult" type="org.jeecg.modules.app.vo.coach.AppCoachDetailsVO">
+        <result property="id" column="id"/>
+        <result property="realname" column="realname"/>
+        <result property="trainingPrograms" column="training_programs"/>
+        <result property="goodRate" column="good_rate"/>
+        <result property="classesNumber" column="classesNumber"/>
+        <result property="teachingPhilosophy" column="teaching_philosophy"/>
+        <result property="excelMsg" column="excel_msg"/>
+        <result property="certificateInnocence" column="certificate_innocence"/>
+        <result property="healthy" column="healthy"/>
+        <result property="honor" column="honor"/>
+        <collection property="courseInfoVOList" ofType="org.jeecg.modules.app.vo.stadium.ConcertsDetailsVO" javaType="java.util.List">
+            <result property="id" column="id" />
+            <result property="startTime" column="start_time" />
+            <result property="endTime" column="end_time"/>
+            <result property="concertStatus" column="concertStatus" />
+            <result property="price" column="selling_price" javaType="java.math.BigDecimal"/>
+        </collection>
+    </resultMap>
     <select id="convertSearchInstructorVOPage" resultType="org.jeecg.modules.app.vo.SearchVO$SearchInstructorVO">
         SELECT
             a.id,
@@ -36,4 +56,13 @@
             a.classes_number
         ORDER BY orderCount DESC
     </select>
+    <select id="findCoachList" resultType="org.jeecg.modules.app.vo.coach.AppCoachVO">
+        select a.user_id as id,b.realname,a.training_programs  from nm_instructor a
+            left join  sys_user b on a.user_id = b.id
+    </select>
+    <select id="findById" resultType="org.jeecg.modules.app.vo.coach.AppCoachDetailsVO">
+        select a.user_id as id,b.realname,a.training_programs,a.good_rate,a.teaching_philosophy,excel_msg,
+               a.certificate_innocence,a.healthy,a.honor  from nm_instructor a left join  sys_user b on a.user_id = b.id where a.user_id = #{id}
+
+    </select>
 </mapper>

+ 3 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/SeparateAccountsMapper.xml

@@ -6,14 +6,14 @@
         select nsa.id, sd.depart_name as merchantName,nsa.pt_separate_accounts,
                nsa.sh_separate_accounts,nsa.md_separate_accounts,nsa.account_status,nsa.update_time
         from nm_separate_accounts nsa
-        left join  sys_dept sd on nsa.dept_id =sd.id
+        left join  sys_depart sd on nsa.dept_id =sd.id
         where nsa.del_flag=0
         <if test="findAccountRequestDTO!=null and findAccountRequestDTO!=''">
         <if test="findAccountRequestDTO.merchantName!=null and findAccountRequestDTO.merchantName!=''">
-            AND sd.depart_name = #{findEvaluateRequestDTO.merchantName}
+            AND sd.depart_name = #{findAccountRequestDTO.merchantName}
         </if>
         <if test="findAccountRequestDTO.accountStatus!=null">
-            AND nsa.account_status = #{findEvaluateRequestDTO.accountStatus}
+            AND nsa.account_status = #{findAccountRequestDTO.accountStatus}
         </if>
         </if>
     </select>

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysUserMapper.xml

@@ -316,7 +316,7 @@
 		</if>
 		and fm.del_flag=0 and fm.user_type=0 ) t
 		left join
-		(select user_id, count(1) from nm_family_members group by  user_id ) t1 on  t.id=t1.user_id
+		(select user_id, count(1)  as familyNum from nm_family_members group by  user_id ) t1 on  t.id=t1.user_id
 		order by  t.create_time desc
 	</select>
 </mapper>