stgl3.1
This commit is contained in:
1 parent
64886ba214
commit
f030749dd5
13 files changed
+408
-380
No files matched your search
+3
-2
@@ -80,8 +80,9 @@ public class StglMyController extends BaseController {
|
||||
@GetMapping("/registrations")
|
||||
public TableDataInfo<MyRegistrationVo> getMyRegistrations(
|
||||
@Parameter(description = "分页参数") PageQuery pageQuery,
|
||||
@Parameter(description = "报名类型(1-社团 2-志愿团队 3-活动)") @RequestParam(required = false) String registrationType) {
|
||||
return stglMyService.queryMyRegistrations(pageQuery, registrationType);
|
||||
@Parameter(description = "报名类型(1-社团 2-志愿团队 3-活动)") @RequestParam(required = false) String registrationType,
|
||||
@Parameter(description = "名称(模糊查询)") @RequestParam(required = false) String name) {
|
||||
return stglMyService.queryMyRegistrations(pageQuery, registrationType, name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-2
@@ -54,10 +54,12 @@ public interface StglMyMapper {
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param registrationType 报名类型(可选)
|
||||
* @param name 名称(可选,模糊查询)
|
||||
* @return 报名记录列表
|
||||
*/
|
||||
List<MyRegistrationVo> selectMyRegistrations(@Param("userId") Long userId,
|
||||
@Param("registrationType") String registrationType);
|
||||
@Param("registrationType") String registrationType,
|
||||
@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 分页查询我的报名记录(社团+志愿团队+活动)
|
||||
@@ -65,11 +67,13 @@ public interface StglMyMapper {
|
||||
* @param page 分页对象
|
||||
* @param userId 用户ID
|
||||
* @param registrationType 报名类型(可选)
|
||||
* @param name 名称(可选,模糊查询)
|
||||
* @return 分页结果
|
||||
*/
|
||||
Page<MyRegistrationVo> selectMyRegistrationsPage(@Param("page") Page<MyRegistrationVo> page,
|
||||
@Param("userId") Long userId,
|
||||
@Param("registrationType") String registrationType);
|
||||
@Param("registrationType") String registrationType,
|
||||
@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询我的报名记录总数
|
||||
|
||||
+2
-1
@@ -47,9 +47,10 @@ public interface IStglMyService {
|
||||
*
|
||||
* @param pageQuery 分页参数
|
||||
* @param registrationType 报名类型(可选)
|
||||
* @param name 名称(可选,模糊查询)
|
||||
* @return 报名记录分页信息
|
||||
*/
|
||||
TableDataInfo<MyRegistrationVo> queryMyRegistrations(PageQuery pageQuery, String registrationType);
|
||||
TableDataInfo<MyRegistrationVo> queryMyRegistrations(PageQuery pageQuery, String registrationType, String name);
|
||||
|
||||
/**
|
||||
* 对活动进行评分
|
||||
|
||||
+2
-2
@@ -72,10 +72,10 @@ public class StglMyServiceImpl implements IStglMyService {
|
||||
* 分页查询我的报名记录
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<MyRegistrationVo> queryMyRegistrations(PageQuery pageQuery, String registrationType) {
|
||||
public TableDataInfo<MyRegistrationVo> queryMyRegistrations(PageQuery pageQuery, String registrationType, String name) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
|
||||
Page<MyRegistrationVo> result = stglMyMapper.selectMyRegistrationsPage(pageQuery.build(), userId, registrationType);
|
||||
Page<MyRegistrationVo> result = stglMyMapper.selectMyRegistrationsPage(pageQuery.build(), userId, registrationType, name);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -267,8 +267,8 @@
|
||||
NULL as approval_time,
|
||||
NULL as approval_by,
|
||||
m.remark,
|
||||
CASE WHEN m.status = '1' THEN '正常' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_role' AND dict_value = CAST(m.role_type AS CHAR) AND tenant_id = '000000') as role,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_status' AND dict_value = CAST(m.status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
m.role_type as role,
|
||||
c.president_name as organizer,
|
||||
c.establish_date as time_info,
|
||||
'' as location,
|
||||
@@ -279,6 +279,9 @@
|
||||
FROM stgl_member m
|
||||
INNER JOIN stgl_club c ON m.relation_id = c.id AND m.member_type = 1 AND m.tenant_id = '000000' AND c.tenant_id = '000000'
|
||||
WHERE m.user_id = #{userId} AND m.deleted = 0 AND c.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND c.club_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
@@ -293,7 +296,7 @@
|
||||
NULL as approval_time,
|
||||
NULL as approval_by,
|
||||
m.remark,
|
||||
CASE WHEN m.status = '1' THEN '正常' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_status' AND dict_value = CAST(m.status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_volunteer_role' AND dict_value = CAST(m.role_type AS CHAR) AND tenant_id = '000000') as role,
|
||||
vt.leader_name as organizer,
|
||||
vt.establish_date as time_info,
|
||||
@@ -305,6 +308,9 @@
|
||||
FROM stgl_member m
|
||||
INNER JOIN stgl_volunteer_team vt ON m.relation_id = vt.id AND m.member_type = 2 AND m.tenant_id = '000000' AND vt.tenant_id = '000000'
|
||||
WHERE m.user_id = #{userId} AND m.deleted = 0 AND vt.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND vt.team_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
@@ -319,7 +325,7 @@
|
||||
ar.approval_time,
|
||||
ar.approval_by,
|
||||
ar.remark,
|
||||
CASE WHEN ar.approval_status = '1' THEN '已报名' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_approval_status' AND dict_value = CAST(ar.approval_status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
'参与者' as role,
|
||||
a.organizer_name as organizer,
|
||||
a.start_time as time_info,
|
||||
@@ -331,10 +337,18 @@
|
||||
FROM stgl_activity_registration ar
|
||||
INNER JOIN stgl_activity a ON ar.activity_id = a.id AND ar.tenant_id = '000000' AND a.tenant_id = '000000'
|
||||
WHERE ar.user_id = #{userId} AND ar.deleted = 0 AND a.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND a.activity_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
<if test="registrationType != null and registrationType != ''">
|
||||
WHERE registration_type = #{registrationType}
|
||||
</if>
|
||||
<where>
|
||||
<if test="registrationType != null and registrationType != ''">
|
||||
AND registration_type = #{registrationType}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND target_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY registration_time DESC
|
||||
</select>
|
||||
|
||||
@@ -379,8 +393,8 @@
|
||||
NULL as approval_time,
|
||||
NULL as approval_by,
|
||||
m.remark,
|
||||
CASE WHEN m.status = '1' THEN '正常' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_role' AND dict_value = CAST(m.role_type AS CHAR) AND tenant_id = '000000') as role,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_status' AND dict_value = CAST(m.status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
m.role_type as role,
|
||||
c.president_name as organizer,
|
||||
c.establish_date as time_info,
|
||||
'' as location,
|
||||
@@ -391,6 +405,9 @@
|
||||
FROM stgl_member m
|
||||
INNER JOIN stgl_club c ON m.relation_id = c.id AND m.member_type = 1 AND m.tenant_id = '000000' AND c.tenant_id = '000000'
|
||||
WHERE m.user_id = #{userId} AND m.deleted = 0 AND c.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND c.club_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
@@ -405,7 +422,7 @@
|
||||
NULL as approval_time,
|
||||
NULL as approval_by,
|
||||
m.remark,
|
||||
CASE WHEN m.status = '1' THEN '正常' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_member_status' AND dict_value = CAST(m.status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_volunteer_role' AND dict_value = CAST(m.role_type AS CHAR) AND tenant_id = '000000') as role,
|
||||
vt.leader_name as organizer,
|
||||
vt.establish_date as time_info,
|
||||
@@ -417,6 +434,9 @@
|
||||
FROM stgl_member m
|
||||
INNER JOIN stgl_volunteer_team vt ON m.relation_id = vt.id AND m.member_type = 2 AND m.tenant_id = '000000' AND vt.tenant_id = '000000'
|
||||
WHERE m.user_id = #{userId} AND m.deleted = 0 AND vt.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND vt.team_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
@@ -431,7 +451,7 @@
|
||||
ar.approval_time,
|
||||
ar.approval_by,
|
||||
ar.remark,
|
||||
CASE WHEN ar.approval_status = '1' THEN '已报名' ELSE '待审核' END as current_status,
|
||||
(SELECT dict_label FROM sys_dict_data WHERE dict_type = 'stgl_approval_status' AND dict_value = CAST(ar.approval_status AS CHAR) AND tenant_id = '000000') as current_status,
|
||||
'参与者' as role,
|
||||
a.organizer_name as organizer,
|
||||
a.start_time as time_info,
|
||||
@@ -443,11 +463,19 @@
|
||||
FROM stgl_activity_registration ar
|
||||
INNER JOIN stgl_activity a ON ar.activity_id = a.id AND ar.tenant_id = '000000' AND a.tenant_id = '000000'
|
||||
WHERE ar.user_id = #{userId} AND ar.deleted = 0 AND a.deleted = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND a.activity_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
)
|
||||
) all_registrations
|
||||
<if test="registrationType != null and registrationType != ''">
|
||||
WHERE registration_type = #{registrationType}
|
||||
</if>
|
||||
<where>
|
||||
<if test="registrationType != null and registrationType != ''">
|
||||
AND registration_type = #{registrationType}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND target_name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY registration_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
Reference in new issue
Block a user