main
parent
9b2ae2c15e
commit
f045477807
|
|
@ -60,6 +60,9 @@ public class AppEvents extends BaseEntity
|
|||
|
||||
private List<Long> ids;
|
||||
|
||||
private Long userId;
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.app.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
|
|
@ -11,6 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
|
|||
* @author wyh
|
||||
* @date 2024-07-23
|
||||
*/
|
||||
@Data
|
||||
public class AppEventsUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
@ -38,6 +40,8 @@ public class AppEventsUser extends BaseEntity
|
|||
@Excel(name = "微信号")
|
||||
private String wechatId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.ruoyi.app.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.app.domain.AppEventsUser;
|
||||
import com.ruoyi.app.mapper.AppEventsUserMapper;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -20,6 +24,9 @@ public class AppEventsServiceImpl implements IAppEventsService
|
|||
@Autowired
|
||||
private AppEventsMapper appEventsMapper;
|
||||
|
||||
@Autowired
|
||||
private AppEventsUserMapper appEventsUserMapper;
|
||||
|
||||
/**
|
||||
* 查询活动发布
|
||||
*
|
||||
|
|
@ -39,8 +46,15 @@ public class AppEventsServiceImpl implements IAppEventsService
|
|||
* @return 活动发布
|
||||
*/
|
||||
@Override
|
||||
public List<AppEvents> selectAppEventsList(AppEvents appEvents)
|
||||
{
|
||||
public List<AppEvents> selectAppEventsList(AppEvents appEvents) {
|
||||
if (appEvents.getType() == 4 && appEvents.getUserId() != null) {
|
||||
AppEventsUser appEventsUser = new AppEventsUser();
|
||||
appEventsUser.setUserId(appEvents.getUserId());
|
||||
List<AppEventsUser> list = appEventsUserMapper.selectAppEventsUserList(appEventsUser);
|
||||
if (list != null && list.size() > 0) {
|
||||
appEvents.setIds(list.stream().map(x->x.getEventsId()).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
return appEventsMapper.selectAppEventsList(appEvents);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
and id in
|
||||
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="updateBy" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="userId" column="user_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppEventsUserVo">
|
||||
select id, events_id, name, company_name, phone, wechat_id, create_time, update_time, create_by, updateBy, remark from app_events_user
|
||||
select id, events_id, name, company_name, phone, wechat_id, create_time, update_time, create_by, updateBy, remark, user_id from app_events_user
|
||||
</sql>
|
||||
|
||||
<select id="selectAppEventsUserList" parameterType="AppEventsUser" resultMap="AppEventsUserResult">
|
||||
|
|
@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="wechatId != null and wechatId != ''"> and wechat_id = #{wechatId}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and updateBy = #{updateBy}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -52,7 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">updateBy,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<if test="userId != null">user_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="eventsId != null">#{eventsId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
|
|
@ -64,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppEventsUser" parameterType="AppEventsUser">
|
||||
|
|
@ -80,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">updateBy = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
Loading…
Reference in New Issue