linhw 2024-07-23 13:53:20 +08:00
parent b4a1ecc024
commit fc4a207d2a
12 changed files with 1131 additions and 0 deletions

View File

@ -0,0 +1,108 @@
package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.app.domain.AppEvents;
import com.ruoyi.app.service.IAppEventsService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wyh
* @date 2024-07-23
*/
@RestController
@RequestMapping("/events")
@Api(tags = "活动发布" , description = "活动发布")
public class AppEventsController extends BaseController
{
@Autowired
private IAppEventsService appEventsService;
/**
*
*/
@GetMapping("/list")
@ApiOperation(value = "查询活动发布", notes = "查询活动发布", httpMethod = "GET")
public TableDataInfo list(AppEvents appEvents)
{
startPage();
List<AppEvents> list = appEventsService.selectAppEventsList(appEvents);
return getDataTable(list);
}
/**
*
*/
@Log(title = "活动发布", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppEvents appEvents)
{
List<AppEvents> list = appEventsService.selectAppEventsList(appEvents);
ExcelUtil<AppEvents> util = new ExcelUtil<AppEvents>(AppEvents.class);
util.exportExcel(response, list, "活动发布数据");
}
/**
*
*/
@GetMapping(value = "/{id}")
@ApiOperation(value = "获取活动发布详细信息", notes = "获取活动发布详细信息", httpMethod = "GET")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appEventsService.selectAppEventsById(id));
}
/**
*
*/
@ApiOperation(value = "新增活动发布", notes = "新增活动发布", httpMethod = "POST")
@Log(title = "活动发布", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody AppEvents appEvents)
{
return toAjax(appEventsService.insertAppEvents(appEvents));
}
/**
*
*/
@ApiOperation(value = "修改活动发布", notes = "修改活动发布", httpMethod = "PUT")
@Log(title = "活动发布", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody AppEvents appEvents)
{
return toAjax(appEventsService.updateAppEvents(appEvents));
}
/**
*
*/
@Log(title = "活动发布", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appEventsService.deleteAppEventsByIds(ids));
}
}

View File

@ -0,0 +1,108 @@
package com.ruoyi.app.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.app.domain.AppEventsUser;
import com.ruoyi.app.service.IAppEventsUserService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wyh
* @date 2024-07-23
*/
@RestController
@RequestMapping("/user")
@Api(tags = "活动发布" , description = "活动发布")
public class AppEventsUserController extends BaseController
{
@Autowired
private IAppEventsUserService appEventsUserService;
/**
*
*/
@GetMapping("/list")
@ApiOperation(value = "查询活动发布", notes = "查询活动发布", httpMethod = "GET")
public TableDataInfo list(AppEventsUser appEventsUser)
{
startPage();
List<AppEventsUser> list = appEventsUserService.selectAppEventsUserList(appEventsUser);
return getDataTable(list);
}
/**
*
*/
@Log(title = "活动发布", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AppEventsUser appEventsUser)
{
List<AppEventsUser> list = appEventsUserService.selectAppEventsUserList(appEventsUser);
ExcelUtil<AppEventsUser> util = new ExcelUtil<AppEventsUser>(AppEventsUser.class);
util.exportExcel(response, list, "活动发布数据");
}
/**
*
*/
@GetMapping(value = "/{id}")
@ApiOperation(value = "获取活动发布详细信息", notes = "获取活动发布详细信息", httpMethod = "GET")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(appEventsUserService.selectAppEventsUserById(id));
}
/**
*
*/
@ApiOperation(value = "新增活动发布", notes = "新增活动发布", httpMethod = "POST")
@Log(title = "活动发布", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody AppEventsUser appEventsUser)
{
return toAjax(appEventsUserService.insertAppEventsUser(appEventsUser));
}
/**
*
*/
@ApiOperation(value = "修改活动发布", notes = "修改活动发布", httpMethod = "PUT")
@Log(title = "活动发布", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody AppEventsUser appEventsUser)
{
return toAjax(appEventsUserService.updateAppEventsUser(appEventsUser));
}
/**
*
*/
@Log(title = "活动发布", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(appEventsUserService.deleteAppEventsUserByIds(ids));
}
}

View File

@ -0,0 +1,158 @@
package com.ruoyi.app.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* app_events
*
* @author wyh
* @date 2024-07-23
*/
public class AppEvents extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 话题id */
private Long id;
/** 活动标题 */
@Excel(name = "活动标题")
private String title;
/** 活动内容 */
@Excel(name = "活动内容")
private String content;
/** 封面 */
@Excel(name = "封面")
private String img;
/** 负责人 */
@Excel(name = "负责人")
private String name;
/** 公司名称 */
@Excel(name = "公司名称")
private String companyName;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 状态1-未开始2-报名中3-已结束 */
@Excel(name = "状态1-未开始2-报名中3-已结束")
private Long type;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setImg(String img)
{
this.img = img;
}
public String getImg()
{
return img;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setType(Long type)
{
this.type = type;
}
public Long getType()
{
return type;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("content", getContent())
.append("img", getImg())
.append("name", getName())
.append("companyName", getCompanyName())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.append("type", getType())
.toString();
}
}

View File

@ -0,0 +1,112 @@
package com.ruoyi.app.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* app_events_user
*
* @author wyh
* @date 2024-07-23
*/
public class AppEventsUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 话题id */
private Long id;
/** 活动id */
@Excel(name = "活动id")
private Long eventsId;
/** 负责人 */
@Excel(name = "负责人")
private String name;
/** 公司名称 */
@Excel(name = "公司名称")
private String companyName;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 微信号 */
@Excel(name = "微信号")
private String wechatId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setEventsId(Long eventsId)
{
this.eventsId = eventsId;
}
public Long getEventsId()
{
return eventsId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setWechatId(String wechatId)
{
this.wechatId = wechatId;
}
public String getWechatId()
{
return wechatId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("eventsId", getEventsId())
.append("name", getName())
.append("companyName", getCompanyName())
.append("phone", getPhone())
.append("wechatId", getWechatId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppEvents;
/**
* Mapper
*
* @author wyh
* @date 2024-07-23
*/
public interface AppEventsMapper
{
/**
*
*
* @param id
* @return
*/
public AppEvents selectAppEventsById(Long id);
/**
*
*
* @param appEvents
* @return
*/
public List<AppEvents> selectAppEventsList(AppEvents appEvents);
/**
*
*
* @param appEvents
* @return
*/
public int insertAppEvents(AppEvents appEvents);
/**
*
*
* @param appEvents
* @return
*/
public int updateAppEvents(AppEvents appEvents);
/**
*
*
* @param id
* @return
*/
public int deleteAppEventsById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAppEventsByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.mapper;
import java.util.List;
import com.ruoyi.app.domain.AppEventsUser;
/**
* Mapper
*
* @author wyh
* @date 2024-07-23
*/
public interface AppEventsUserMapper
{
/**
*
*
* @param id
* @return
*/
public AppEventsUser selectAppEventsUserById(Long id);
/**
*
*
* @param appEventsUser
* @return
*/
public List<AppEventsUser> selectAppEventsUserList(AppEventsUser appEventsUser);
/**
*
*
* @param appEventsUser
* @return
*/
public int insertAppEventsUser(AppEventsUser appEventsUser);
/**
*
*
* @param appEventsUser
* @return
*/
public int updateAppEventsUser(AppEventsUser appEventsUser);
/**
*
*
* @param id
* @return
*/
public int deleteAppEventsUserById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteAppEventsUserByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppEvents;
/**
* Service
*
* @author wyh
* @date 2024-07-23
*/
public interface IAppEventsService
{
/**
*
*
* @param id
* @return
*/
public AppEvents selectAppEventsById(Long id);
/**
*
*
* @param appEvents
* @return
*/
public List<AppEvents> selectAppEventsList(AppEvents appEvents);
/**
*
*
* @param appEvents
* @return
*/
public int insertAppEvents(AppEvents appEvents);
/**
*
*
* @param appEvents
* @return
*/
public int updateAppEvents(AppEvents appEvents);
/**
*
*
* @param ids
* @return
*/
public int deleteAppEventsByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAppEventsById(Long id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.app.service;
import java.util.List;
import com.ruoyi.app.domain.AppEventsUser;
/**
* Service
*
* @author wyh
* @date 2024-07-23
*/
public interface IAppEventsUserService
{
/**
*
*
* @param id
* @return
*/
public AppEventsUser selectAppEventsUserById(Long id);
/**
*
*
* @param appEventsUser
* @return
*/
public List<AppEventsUser> selectAppEventsUserList(AppEventsUser appEventsUser);
/**
*
*
* @param appEventsUser
* @return
*/
public int insertAppEventsUser(AppEventsUser appEventsUser);
/**
*
*
* @param appEventsUser
* @return
*/
public int updateAppEventsUser(AppEventsUser appEventsUser);
/**
*
*
* @param ids
* @return
*/
public int deleteAppEventsUserByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteAppEventsUserById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.app.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppEventsMapper;
import com.ruoyi.app.domain.AppEvents;
import com.ruoyi.app.service.IAppEventsService;
/**
* Service
*
* @author wyh
* @date 2024-07-23
*/
@Service
public class AppEventsServiceImpl implements IAppEventsService
{
@Autowired
private AppEventsMapper appEventsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public AppEvents selectAppEventsById(Long id)
{
return appEventsMapper.selectAppEventsById(id);
}
/**
*
*
* @param appEvents
* @return
*/
@Override
public List<AppEvents> selectAppEventsList(AppEvents appEvents)
{
return appEventsMapper.selectAppEventsList(appEvents);
}
/**
*
*
* @param appEvents
* @return
*/
@Override
public int insertAppEvents(AppEvents appEvents)
{
appEvents.setCreateTime(DateUtils.getNowDate());
return appEventsMapper.insertAppEvents(appEvents);
}
/**
*
*
* @param appEvents
* @return
*/
@Override
public int updateAppEvents(AppEvents appEvents)
{
appEvents.setUpdateTime(DateUtils.getNowDate());
return appEventsMapper.updateAppEvents(appEvents);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAppEventsByIds(Long[] ids)
{
return appEventsMapper.deleteAppEventsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAppEventsById(Long id)
{
return appEventsMapper.deleteAppEventsById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.app.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.AppEventsUserMapper;
import com.ruoyi.app.domain.AppEventsUser;
import com.ruoyi.app.service.IAppEventsUserService;
/**
* Service
*
* @author wyh
* @date 2024-07-23
*/
@Service
public class AppEventsUserServiceImpl implements IAppEventsUserService
{
@Autowired
private AppEventsUserMapper appEventsUserMapper;
/**
*
*
* @param id
* @return
*/
@Override
public AppEventsUser selectAppEventsUserById(Long id)
{
return appEventsUserMapper.selectAppEventsUserById(id);
}
/**
*
*
* @param appEventsUser
* @return
*/
@Override
public List<AppEventsUser> selectAppEventsUserList(AppEventsUser appEventsUser)
{
return appEventsUserMapper.selectAppEventsUserList(appEventsUser);
}
/**
*
*
* @param appEventsUser
* @return
*/
@Override
public int insertAppEventsUser(AppEventsUser appEventsUser)
{
appEventsUser.setCreateTime(DateUtils.getNowDate());
return appEventsUserMapper.insertAppEventsUser(appEventsUser);
}
/**
*
*
* @param appEventsUser
* @return
*/
@Override
public int updateAppEventsUser(AppEventsUser appEventsUser)
{
appEventsUser.setUpdateTime(DateUtils.getNowDate());
return appEventsUserMapper.updateAppEventsUser(appEventsUser);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteAppEventsUserByIds(Long[] ids)
{
return appEventsUserMapper.deleteAppEventsUserByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteAppEventsUserById(Long id)
{
return appEventsUserMapper.deleteAppEventsUserById(id);
}
}

View File

@ -0,0 +1,112 @@
<?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="com.ruoyi.app.mapper.AppEventsMapper">
<resultMap type="AppEvents" id="AppEventsResult">
<result property="id" column="id" />
<result property="title" column="title" />
<result property="content" column="content" />
<result property="img" column="img" />
<result property="name" column="name" />
<result property="companyName" column="company_name" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
<result property="type" column="type" />
</resultMap>
<sql id="selectAppEventsVo">
select id, title, content, img, name, company_name, start_time, end_time, create_time, update_time, create_by, updateBy, remark, type from app_events
</sql>
<select id="selectAppEventsList" parameterType="AppEvents" resultMap="AppEventsResult">
<include refid="selectAppEventsVo"/>
<where>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="img != null and img != ''"> and img = #{img}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<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>
</where>
</select>
<select id="selectAppEventsById" parameterType="Long" resultMap="AppEventsResult">
<include refid="selectAppEventsVo"/>
where id = #{id}
</select>
<insert id="insertAppEvents" parameterType="AppEvents" useGeneratedKeys="true" keyProperty="id">
insert into app_events
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">title,</if>
<if test="content != null">content,</if>
<if test="img != null">img,</if>
<if test="name != null">name,</if>
<if test="companyName != null">company_name,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">#{title},</if>
<if test="content != null">#{content},</if>
<if test="img != null">#{img},</if>
<if test="name != null">#{name},</if>
<if test="companyName != null">#{companyName},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<update id="updateAppEvents" parameterType="AppEvents">
update app_events
<trim prefix="SET" suffixOverrides=",">
<if test="title != null">title = #{title},</if>
<if test="content != null">content = #{content},</if>
<if test="img != null">img = #{img},</if>
<if test="name != null">name = #{name},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="type != null">type = #{type},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppEventsById" parameterType="Long">
delete from app_events where id = #{id}
</delete>
<delete id="deleteAppEventsByIds" parameterType="String">
delete from app_events where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,97 @@
<?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="com.ruoyi.app.mapper.AppEventsUserMapper">
<resultMap type="AppEventsUser" id="AppEventsUserResult">
<result property="id" column="id" />
<result property="eventsId" column="events_id" />
<result property="name" column="name" />
<result property="companyName" column="company_name" />
<result property="phone" column="phone" />
<result property="wechatId" column="wechat_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="updateBy" />
<result property="remark" column="remark" />
</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
</sql>
<select id="selectAppEventsUserList" parameterType="AppEventsUser" resultMap="AppEventsUserResult">
<include refid="selectAppEventsUserVo"/>
<where>
<if test="eventsId != null "> and events_id = #{eventsId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<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>
</where>
</select>
<select id="selectAppEventsUserById" parameterType="Long" resultMap="AppEventsUserResult">
<include refid="selectAppEventsUserVo"/>
where id = #{id}
</select>
<insert id="insertAppEventsUser" parameterType="AppEventsUser" useGeneratedKeys="true" keyProperty="id">
insert into app_events_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventsId != null">events_id,</if>
<if test="name != null">name,</if>
<if test="companyName != null">company_name,</if>
<if test="phone != null">phone,</if>
<if test="wechatId != null">wechat_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">updateBy,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="eventsId != null">#{eventsId},</if>
<if test="name != null">#{name},</if>
<if test="companyName != null">#{companyName},</if>
<if test="phone != null">#{phone},</if>
<if test="wechatId != null">#{wechatId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppEventsUser" parameterType="AppEventsUser">
update app_events_user
<trim prefix="SET" suffixOverrides=",">
<if test="eventsId != null">events_id = #{eventsId},</if>
<if test="name != null">name = #{name},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="wechatId != null">wechat_id = #{wechatId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">updateBy = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppEventsUserById" parameterType="Long">
delete from app_events_user where id = #{id}
</delete>
<delete id="deleteAppEventsUserByIds" parameterType="String">
delete from app_events_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>