新增加比赛管理页面

This commit is contained in:
wuyibo
2022-11-02 17:18:28 +08:00
parent 6abd0eea0e
commit 9181e9eb41
12 changed files with 2476 additions and 1 deletions

View File

@@ -0,0 +1,105 @@
package com.ruoyi.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.system.domain.Competition;
import com.ruoyi.system.service.ICompetitionService;
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 ruoyi
* @date 2022-11-02
*/
@RestController
@RequestMapping("/competition")
public class CompetitionController extends BaseController
{
@Autowired
private ICompetitionService competitionService;
/**
* 查询比赛信息列表
*/
@RequiresPermissions("system:competition:list")
@GetMapping("/list")
public TableDataInfo list(Competition competition)
{
startPage();
List<Competition> list = competitionService.selectCompetitionList(competition);
return getDataTable(list);
}
/**
* 导出比赛信息列表
*/
@RequiresPermissions("system:competition:export")
@Log(title = "比赛信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Competition competition)
{
List<Competition> list = competitionService.selectCompetitionList(competition);
ExcelUtil<Competition> util = new ExcelUtil<Competition>(Competition.class);
util.exportExcel(response, list, "比赛信息数据");
}
/**
* 获取比赛信息详细信息
*/
@RequiresPermissions("system:competition:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(competitionService.selectCompetitionById(id));
}
/**
* 新增比赛信息
*/
@RequiresPermissions("system:competition:add")
@Log(title = "比赛信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Competition competition)
{
return toAjax(competitionService.insertCompetition(competition));
}
/**
* 修改比赛信息
*/
@RequiresPermissions("system:competition:edit")
@Log(title = "比赛信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Competition competition)
{
return toAjax(competitionService.updateCompetition(competition));
}
/**
* 删除比赛信息
*/
@RequiresPermissions("system:competition:remove")
@Log(title = "比赛信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(competitionService.deleteCompetitionByIds(ids));
}
}

View File

@@ -0,0 +1,100 @@
package com.ruoyi.system.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.Competition;
import com.ruoyi.system.service.ICompetitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author 吴一博
* @date 2022年11月02日 15:43
* @Description
*/
/**
* 约战Controller
* @date 2022-11-02
*/
@RestController
@RequestMapping("/vs")
public class CompetitionVsController extends BaseController {
@Autowired
private ICompetitionService competitionService;
/**
* 查询约战列表
*/
@RequiresPermissions("system:vs:list")
@GetMapping("/list")
public TableDataInfo list(Competition competition)
{
startPage();
List<Competition> list = competitionService.selectCompetitionList(competition);
return getDataTable(list);
}
/**
* 导出约战列表
*/
@RequiresPermissions("system:vs:export")
@Log(title = "约战", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Competition competition)
{
List<Competition> list = competitionService.selectCompetitionList(competition);
ExcelUtil<Competition> util = new ExcelUtil<Competition>(Competition.class);
util.exportExcel(response, list, "约战数据");
}
/**
* 获取约战详细信息
*/
@RequiresPermissions("system:vs:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(competitionService.selectCompetitionById(id));
}
/**
* 新增约战
*/
@RequiresPermissions("system:vs:add")
@Log(title = "约战", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Competition competition)
{
return toAjax(competitionService.insertCompetition(competition));
}
/**
* 修改约战
*/
@RequiresPermissions("system:vs:edit")
@Log(title = "约战", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Competition competition)
{
return toAjax(competitionService.updateCompetition(competition));
}
/**
* 删除约战
*/
@RequiresPermissions("system:vs:remove")
@Log(title = "约战", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(competitionService.deleteCompetitionByIds(ids));
}
}

View File

@@ -0,0 +1,593 @@
package com.ruoyi.system.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;
/**
* 比赛信息对象 competition
*
* @author ruoyi
* @date 2022-11-02
*/
public class Competition extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 主队ID */
@Excel(name = "主队ID")
private Long mainTeamId;
/** 主队名 */
@Excel(name = "主队名")
private String mainTeamName;
/** 客队ID */
@Excel(name = "客队ID")
private Long guestTeamId;
/** 客队名 */
@Excel(name = "客队名")
private String guestTeamName;
/** 赛事编号 */
@Excel(name = "赛事编号")
private String competitionCode;
/** 比赛名称 */
@Excel(name = "比赛名称")
private String competitionName;
/** 是否指定对手 */
@Excel(name = "是否指定对手")
private Integer designated;
/** 比赛类型,1,2,3,4,5,6 */
@Excel(name = "比赛类型,1,2,3,4,5,6")
private Long competitionType;
/** 比赛时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "比赛时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date competitionTime;
/** 球场ID */
@Excel(name = "球场ID")
private Long buildingId;
/** 球场名称 */
@Excel(name = "球场名称")
private String buildingName;
/** 比赛地址 */
@Excel(name = "比赛地址")
private String competitionAddress;
/** 发起人ID */
@Excel(name = "发起人ID")
private Long founder;
/** 比赛状态 */
@Excel(name = "比赛状态")
private Integer status;
/** 城市编码 */
@Excel(name = "城市编码")
private String cityCode;
/** 城市名称 */
@Excel(name = "城市名称")
private String cityName;
/** 最大参与人数 */
@Excel(name = "最大参与人数")
private Long maxPlayer;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdTime;
/** 最后修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后修改时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastUpdatedTime;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 最后修改人 */
@Excel(name = "最后修改人")
private String modifiedBy;
/** 是否删除 */
@Excel(name = "是否删除")
private Long isDeleted;
/** 经度 */
@Excel(name = "经度")
private Long longitude;
/** 纬度 */
@Excel(name = "纬度")
private Long latitude;
/** 比赛性质0=约战1=赛事) */
@Excel(name = "比赛性质", readConverterExp = "0==约战1=赛事")
private Integer competitionNature;
/** 报名开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报名开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date enrollBeginTime;
/** 报名结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报名结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date enrollEndTime;
/** 赛事联系人 */
@Excel(name = "赛事联系人")
private String contacts;
/** 赛事联系人电话区号 */
@Excel(name = "赛事联系人电话区号")
private String contactsAreaCode;
/** 赛事联系人电话 */
@Excel(name = "赛事联系人电话")
private String contactsTel;
/** 比赛开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "比赛开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date competitionBeginTime;
/** 比赛结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "比赛结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date competitionEndTime;
/** 主办方 */
@Excel(name = "主办方")
private String organizer;
/** 承办方 */
@Excel(name = "承办方")
private String undertake;
/** 赛会背景图 */
@Excel(name = "赛会背景图")
private String competitionBackImg;
/** 创建人userId */
@Excel(name = "创建人userId")
private Long createdId;
/** 审核状态0=待审核1=已审核;-1=审核不过 */
@Excel(name = "审核状态0=待审核1=已审核;-1=审核不过")
private Long auditStatus;
/** 身高隐藏 0不隐藏 1=隐藏 */
@Excel(name = "身高隐藏 0不隐藏 1=隐藏")
private Integer heightHide;
/** 赞助商 */
@Excel(name = "赞助商")
private String sponsor;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMainTeamId(Long mainTeamId)
{
this.mainTeamId = mainTeamId;
}
public Long getMainTeamId()
{
return mainTeamId;
}
public void setMainTeamName(String mainTeamName)
{
this.mainTeamName = mainTeamName;
}
public String getMainTeamName()
{
return mainTeamName;
}
public void setGuestTeamId(Long guestTeamId)
{
this.guestTeamId = guestTeamId;
}
public Long getGuestTeamId()
{
return guestTeamId;
}
public void setGuestTeamName(String guestTeamName)
{
this.guestTeamName = guestTeamName;
}
public String getGuestTeamName()
{
return guestTeamName;
}
public void setCompetitionCode(String competitionCode)
{
this.competitionCode = competitionCode;
}
public String getCompetitionCode()
{
return competitionCode;
}
public void setCompetitionName(String competitionName)
{
this.competitionName = competitionName;
}
public String getCompetitionName()
{
return competitionName;
}
public void setDesignated(Integer designated)
{
this.designated = designated;
}
public Integer getDesignated()
{
return designated;
}
public void setCompetitionType(Long competitionType)
{
this.competitionType = competitionType;
}
public Long getCompetitionType()
{
return competitionType;
}
public void setCompetitionTime(Date competitionTime)
{
this.competitionTime = competitionTime;
}
public Date getCompetitionTime()
{
return competitionTime;
}
public void setBuildingId(Long buildingId)
{
this.buildingId = buildingId;
}
public Long getBuildingId()
{
return buildingId;
}
public void setBuildingName(String buildingName)
{
this.buildingName = buildingName;
}
public String getBuildingName()
{
return buildingName;
}
public void setCompetitionAddress(String competitionAddress)
{
this.competitionAddress = competitionAddress;
}
public String getCompetitionAddress()
{
return competitionAddress;
}
public void setFounder(Long founder)
{
this.founder = founder;
}
public Long getFounder()
{
return founder;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public void setCityCode(String cityCode)
{
this.cityCode = cityCode;
}
public String getCityCode()
{
return cityCode;
}
public void setCityName(String cityName)
{
this.cityName = cityName;
}
public String getCityName()
{
return cityName;
}
public void setMaxPlayer(Long maxPlayer)
{
this.maxPlayer = maxPlayer;
}
public Long getMaxPlayer()
{
return maxPlayer;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setLastUpdatedTime(Date lastUpdatedTime)
{
this.lastUpdatedTime = lastUpdatedTime;
}
public Date getLastUpdatedTime()
{
return lastUpdatedTime;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setModifiedBy(String modifiedBy)
{
this.modifiedBy = modifiedBy;
}
public String getModifiedBy()
{
return modifiedBy;
}
public void setIsDeleted(Long isDeleted)
{
this.isDeleted = isDeleted;
}
public Long getIsDeleted()
{
return isDeleted;
}
public void setLongitude(Long longitude)
{
this.longitude = longitude;
}
public Long getLongitude()
{
return longitude;
}
public void setLatitude(Long latitude)
{
this.latitude = latitude;
}
public Long getLatitude()
{
return latitude;
}
public void setCompetitionNature(Integer competitionNature)
{
this.competitionNature = competitionNature;
}
public Integer getCompetitionNature()
{
return competitionNature;
}
public void setEnrollBeginTime(Date enrollBeginTime)
{
this.enrollBeginTime = enrollBeginTime;
}
public Date getEnrollBeginTime()
{
return enrollBeginTime;
}
public void setEnrollEndTime(Date enrollEndTime)
{
this.enrollEndTime = enrollEndTime;
}
public Date getEnrollEndTime()
{
return enrollEndTime;
}
public void setContacts(String contacts)
{
this.contacts = contacts;
}
public String getContacts()
{
return contacts;
}
public void setContactsAreaCode(String contactsAreaCode)
{
this.contactsAreaCode = contactsAreaCode;
}
public String getContactsAreaCode()
{
return contactsAreaCode;
}
public void setContactsTel(String contactsTel)
{
this.contactsTel = contactsTel;
}
public String getContactsTel()
{
return contactsTel;
}
public void setCompetitionBeginTime(Date competitionBeginTime)
{
this.competitionBeginTime = competitionBeginTime;
}
public Date getCompetitionBeginTime()
{
return competitionBeginTime;
}
public void setCompetitionEndTime(Date competitionEndTime)
{
this.competitionEndTime = competitionEndTime;
}
public Date getCompetitionEndTime()
{
return competitionEndTime;
}
public void setOrganizer(String organizer)
{
this.organizer = organizer;
}
public String getOrganizer()
{
return organizer;
}
public void setUndertake(String undertake)
{
this.undertake = undertake;
}
public String getUndertake()
{
return undertake;
}
public void setCompetitionBackImg(String competitionBackImg)
{
this.competitionBackImg = competitionBackImg;
}
public String getCompetitionBackImg()
{
return competitionBackImg;
}
public void setCreatedId(Long createdId)
{
this.createdId = createdId;
}
public Long getCreatedId()
{
return createdId;
}
public void setAuditStatus(Long auditStatus)
{
this.auditStatus = auditStatus;
}
public Long getAuditStatus()
{
return auditStatus;
}
public void setHeightHide(Integer heightHide)
{
this.heightHide = heightHide;
}
public Integer getHeightHide()
{
return heightHide;
}
public void setSponsor(String sponsor)
{
this.sponsor = sponsor;
}
public String getSponsor()
{
return sponsor;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mainTeamId", getMainTeamId())
.append("mainTeamName", getMainTeamName())
.append("guestTeamId", getGuestTeamId())
.append("guestTeamName", getGuestTeamName())
.append("competitionCode", getCompetitionCode())
.append("competitionName", getCompetitionName())
.append("designated", getDesignated())
.append("competitionType", getCompetitionType())
.append("competitionTime", getCompetitionTime())
.append("buildingId", getBuildingId())
.append("buildingName", getBuildingName())
.append("competitionAddress", getCompetitionAddress())
.append("founder", getFounder())
.append("status", getStatus())
.append("cityCode", getCityCode())
.append("cityName", getCityName())
.append("maxPlayer", getMaxPlayer())
.append("createdTime", getCreatedTime())
.append("lastUpdatedTime", getLastUpdatedTime())
.append("createdBy", getCreatedBy())
.append("modifiedBy", getModifiedBy())
.append("isDeleted", getIsDeleted())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("remark", getRemark())
.append("competitionNature", getCompetitionNature())
.append("enrollBeginTime", getEnrollBeginTime())
.append("enrollEndTime", getEnrollEndTime())
.append("contacts", getContacts())
.append("contactsAreaCode", getContactsAreaCode())
.append("contactsTel", getContactsTel())
.append("competitionBeginTime", getCompetitionBeginTime())
.append("competitionEndTime", getCompetitionEndTime())
.append("organizer", getOrganizer())
.append("undertake", getUndertake())
.append("competitionBackImg", getCompetitionBackImg())
.append("createdId", getCreatedId())
.append("auditStatus", getAuditStatus())
.append("heightHide", getHeightHide())
.append("sponsor", getSponsor())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Competition;
/**
* 比赛信息Mapper接口
*
* @author ruoyi
* @date 2022-11-02
*/
public interface CompetitionMapper
{
/**
* 查询比赛信息
*
* @param id 比赛信息主键
* @return 比赛信息
*/
public Competition selectCompetitionById(Long id);
/**
* 查询比赛信息列表
*
* @param competition 比赛信息
* @return 比赛信息集合
*/
public List<Competition> selectCompetitionList(Competition competition);
/**
* 新增比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
public int insertCompetition(Competition competition);
/**
* 修改比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
public int updateCompetition(Competition competition);
/**
* 删除比赛信息
*
* @param id 比赛信息主键
* @return 结果
*/
public int deleteCompetitionById(Long id);
/**
* 批量删除比赛信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteCompetitionByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Competition;
/**
* 比赛信息Service接口
*
* @author ruoyi
* @date 2022-11-02
*/
public interface ICompetitionService
{
/**
* 查询比赛信息
*
* @param id 比赛信息主键
* @return 比赛信息
*/
public Competition selectCompetitionById(Long id);
/**
* 查询比赛信息列表
*
* @param competition 比赛信息
* @return 比赛信息集合
*/
public List<Competition> selectCompetitionList(Competition competition);
/**
* 新增比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
public int insertCompetition(Competition competition);
/**
* 修改比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
public int updateCompetition(Competition competition);
/**
* 批量删除比赛信息
*
* @param ids 需要删除的比赛信息主键集合
* @return 结果
*/
public int deleteCompetitionByIds(Long[] ids);
/**
* 删除比赛信息信息
*
* @param id 比赛信息主键
* @return 结果
*/
public int deleteCompetitionById(Long id);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CompetitionMapper;
import com.ruoyi.system.domain.Competition;
import com.ruoyi.system.service.ICompetitionService;
/**
* 比赛信息Service业务层处理
*
* @author ruoyi
* @date 2022-11-02
*/
@Service
public class CompetitionServiceImpl implements ICompetitionService
{
@Autowired
private CompetitionMapper competitionMapper;
/**
* 查询比赛信息
*
* @param id 比赛信息主键
* @return 比赛信息
*/
@Override
public Competition selectCompetitionById(Long id)
{
return competitionMapper.selectCompetitionById(id);
}
/**
* 查询比赛信息列表
*
* @param competition 比赛信息
* @return 比赛信息
*/
@Override
public List<Competition> selectCompetitionList(Competition competition)
{
return competitionMapper.selectCompetitionList(competition);
}
/**
* 新增比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
@Override
public int insertCompetition(Competition competition)
{
return competitionMapper.insertCompetition(competition);
}
/**
* 修改比赛信息
*
* @param competition 比赛信息
* @return 结果
*/
@Override
public int updateCompetition(Competition competition)
{
return competitionMapper.updateCompetition(competition);
}
/**
* 批量删除比赛信息
*
* @param ids 需要删除的比赛信息主键
* @return 结果
*/
@Override
public int deleteCompetitionByIds(Long[] ids)
{
return competitionMapper.deleteCompetitionByIds(ids);
}
/**
* 删除比赛信息信息
*
* @param id 比赛信息主键
* @return 结果
*/
@Override
public int deleteCompetitionById(Long id)
{
return competitionMapper.deleteCompetitionById(id);
}
}

View File

@@ -0,0 +1,250 @@
<?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.system.mapper.CompetitionMapper">
<resultMap type="Competition" id="CompetitionResult">
<result property="id" column="id" />
<result property="mainTeamId" column="main_team_id" />
<result property="mainTeamName" column="main_team_name" />
<result property="guestTeamId" column="guest_team_id" />
<result property="guestTeamName" column="guest_team_name" />
<result property="competitionCode" column="competition_code" />
<result property="competitionName" column="competition_name" />
<result property="designated" column="designated" />
<result property="competitionType" column="competition_type" />
<result property="competitionTime" column="competition_time" />
<result property="buildingId" column="building_id" />
<result property="buildingName" column="building_name" />
<result property="competitionAddress" column="competition_address" />
<result property="founder" column="founder" />
<result property="status" column="status" />
<result property="cityCode" column="city_code" />
<result property="cityName" column="city_name" />
<result property="maxPlayer" column="max_player" />
<result property="createdTime" column="created_time" />
<result property="lastUpdatedTime" column="last_updated_time" />
<result property="createdBy" column="created_by" />
<result property="modifiedBy" column="modified_by" />
<result property="isDeleted" column="is_deleted" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="remark" column="remark" />
<result property="competitionNature" column="competition_nature" />
<result property="enrollBeginTime" column="enroll_begin_time" />
<result property="enrollEndTime" column="enroll_end_time" />
<result property="contacts" column="contacts" />
<result property="contactsAreaCode" column="contacts_area_code" />
<result property="contactsTel" column="contacts_tel" />
<result property="competitionBeginTime" column="competition_begin_time" />
<result property="competitionEndTime" column="competition_end_time" />
<result property="organizer" column="organizer" />
<result property="undertake" column="undertake" />
<result property="competitionBackImg" column="competition_back_img" />
<result property="createdId" column="created_id" />
<result property="auditStatus" column="audit_status" />
<result property="heightHide" column="height_hide" />
<result property="sponsor" column="sponsor" />
</resultMap>
<sql id="selectCompetitionVo">
select id, main_team_id, main_team_name, guest_team_id, guest_team_name, competition_code, competition_name, designated, competition_type, competition_time, building_id, building_name, competition_address, founder, status, city_code, city_name, max_player, created_time, last_updated_time, created_by, modified_by, is_deleted, longitude, latitude, remark, competition_nature, enroll_begin_time, enroll_end_time, contacts, contacts_area_code, contacts_tel, competition_begin_time, competition_end_time, organizer, undertake, competition_back_img, created_id, audit_status, height_hide, sponsor from competition
</sql>
<select id="selectCompetitionList" parameterType="Competition" resultMap="CompetitionResult">
<include refid="selectCompetitionVo"/>
<where>
<if test="mainTeamId != null "> and main_team_id = #{mainTeamId}</if>
<if test="mainTeamName != null and mainTeamName != ''"> and main_team_name like concat('%', #{mainTeamName}, '%')</if>
<if test="guestTeamId != null "> and guest_team_id = #{guestTeamId}</if>
<if test="guestTeamName != null and guestTeamName != ''"> and guest_team_name like concat('%', #{guestTeamName}, '%')</if>
<if test="competitionCode != null and competitionCode != ''"> and competition_code = #{competitionCode}</if>
<if test="competitionName != null and competitionName != ''"> and competition_name like concat('%', #{competitionName}, '%')</if>
<if test="designated != null "> and designated = #{designated}</if>
<if test="competitionType != null "> and competition_type = #{competitionType}</if>
<if test="competitionTime != null "> and competition_time = #{competitionTime}</if>
<if test="buildingId != null "> and building_id = #{buildingId}</if>
<if test="buildingName != null and buildingName != ''"> and building_name like concat('%', #{buildingName}, '%')</if>
<if test="competitionAddress != null and competitionAddress != ''"> and competition_address = #{competitionAddress}</if>
<if test="founder != null "> and founder = #{founder}</if>
<if test="status != null "> and status = #{status}</if>
<if test="cityCode != null and cityCode != ''"> and city_code = #{cityCode}</if>
<if test="cityName != null and cityName != ''"> and city_name like concat('%', #{cityName}, '%')</if>
<if test="maxPlayer != null "> and max_player = #{maxPlayer}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="lastUpdatedTime != null "> and last_updated_time = #{lastUpdatedTime}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="modifiedBy != null and modifiedBy != ''"> and modified_by = #{modifiedBy}</if>
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="competitionNature != null "> and competition_nature = #{competitionNature}</if>
<if test="enrollBeginTime != null "> and enroll_begin_time = #{enrollBeginTime}</if>
<if test="enrollEndTime != null "> and enroll_end_time = #{enrollEndTime}</if>
<if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
<if test="contactsAreaCode != null and contactsAreaCode != ''"> and contacts_area_code = #{contactsAreaCode}</if>
<if test="contactsTel != null and contactsTel != ''"> and contacts_tel = #{contactsTel}</if>
<if test="competitionBeginTime != null "> and competition_begin_time = #{competitionBeginTime}</if>
<if test="competitionEndTime != null "> and competition_end_time = #{competitionEndTime}</if>
<if test="organizer != null and organizer != ''"> and organizer = #{organizer}</if>
<if test="undertake != null and undertake != ''"> and undertake = #{undertake}</if>
<if test="competitionBackImg != null and competitionBackImg != ''"> and competition_back_img = #{competitionBackImg}</if>
<if test="createdId != null "> and created_id = #{createdId}</if>
<if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
<if test="heightHide != null "> and height_hide = #{heightHide}</if>
<if test="sponsor != null and sponsor != ''"> and sponsor = #{sponsor}</if>
</where>
</select>
<select id="selectCompetitionById" parameterType="Long" resultMap="CompetitionResult">
<include refid="selectCompetitionVo"/>
where id = #{id}
</select>
<insert id="insertCompetition" parameterType="Competition" useGeneratedKeys="true" keyProperty="id">
insert into competition
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mainTeamId != null">main_team_id,</if>
<if test="mainTeamName != null">main_team_name,</if>
<if test="guestTeamId != null">guest_team_id,</if>
<if test="guestTeamName != null">guest_team_name,</if>
<if test="competitionCode != null">competition_code,</if>
<if test="competitionName != null">competition_name,</if>
<if test="designated != null">designated,</if>
<if test="competitionType != null">competition_type,</if>
<if test="competitionTime != null">competition_time,</if>
<if test="buildingId != null">building_id,</if>
<if test="buildingName != null">building_name,</if>
<if test="competitionAddress != null">competition_address,</if>
<if test="founder != null">founder,</if>
<if test="status != null">status,</if>
<if test="cityCode != null">city_code,</if>
<if test="cityName != null">city_name,</if>
<if test="maxPlayer != null">max_player,</if>
<if test="createdTime != null">created_time,</if>
<if test="lastUpdatedTime != null">last_updated_time,</if>
<if test="createdBy != null">created_by,</if>
<if test="modifiedBy != null">modified_by,</if>
<if test="isDeleted != null">is_deleted,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="remark != null">remark,</if>
<if test="competitionNature != null">competition_nature,</if>
<if test="enrollBeginTime != null">enroll_begin_time,</if>
<if test="enrollEndTime != null">enroll_end_time,</if>
<if test="contacts != null">contacts,</if>
<if test="contactsAreaCode != null">contacts_area_code,</if>
<if test="contactsTel != null">contacts_tel,</if>
<if test="competitionBeginTime != null">competition_begin_time,</if>
<if test="competitionEndTime != null">competition_end_time,</if>
<if test="organizer != null">organizer,</if>
<if test="undertake != null">undertake,</if>
<if test="competitionBackImg != null">competition_back_img,</if>
<if test="createdId != null">created_id,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="heightHide != null">height_hide,</if>
<if test="sponsor != null">sponsor,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mainTeamId != null">#{mainTeamId},</if>
<if test="mainTeamName != null">#{mainTeamName},</if>
<if test="guestTeamId != null">#{guestTeamId},</if>
<if test="guestTeamName != null">#{guestTeamName},</if>
<if test="competitionCode != null">#{competitionCode},</if>
<if test="competitionName != null">#{competitionName},</if>
<if test="designated != null">#{designated},</if>
<if test="competitionType != null">#{competitionType},</if>
<if test="competitionTime != null">#{competitionTime},</if>
<if test="buildingId != null">#{buildingId},</if>
<if test="buildingName != null">#{buildingName},</if>
<if test="competitionAddress != null">#{competitionAddress},</if>
<if test="founder != null">#{founder},</if>
<if test="status != null">#{status},</if>
<if test="cityCode != null">#{cityCode},</if>
<if test="cityName != null">#{cityName},</if>
<if test="maxPlayer != null">#{maxPlayer},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="lastUpdatedTime != null">#{lastUpdatedTime},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="modifiedBy != null">#{modifiedBy},</if>
<if test="isDeleted != null">#{isDeleted},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="remark != null">#{remark},</if>
<if test="competitionNature != null">#{competitionNature},</if>
<if test="enrollBeginTime != null">#{enrollBeginTime},</if>
<if test="enrollEndTime != null">#{enrollEndTime},</if>
<if test="contacts != null">#{contacts},</if>
<if test="contactsAreaCode != null">#{contactsAreaCode},</if>
<if test="contactsTel != null">#{contactsTel},</if>
<if test="competitionBeginTime != null">#{competitionBeginTime},</if>
<if test="competitionEndTime != null">#{competitionEndTime},</if>
<if test="organizer != null">#{organizer},</if>
<if test="undertake != null">#{undertake},</if>
<if test="competitionBackImg != null">#{competitionBackImg},</if>
<if test="createdId != null">#{createdId},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="heightHide != null">#{heightHide},</if>
<if test="sponsor != null">#{sponsor},</if>
</trim>
</insert>
<update id="updateCompetition" parameterType="Competition">
update competition
<trim prefix="SET" suffixOverrides=",">
<if test="mainTeamId != null">main_team_id = #{mainTeamId},</if>
<if test="mainTeamName != null">main_team_name = #{mainTeamName},</if>
<if test="guestTeamId != null">guest_team_id = #{guestTeamId},</if>
<if test="guestTeamName != null">guest_team_name = #{guestTeamName},</if>
<if test="competitionCode != null">competition_code = #{competitionCode},</if>
<if test="competitionName != null">competition_name = #{competitionName},</if>
<if test="designated != null">designated = #{designated},</if>
<if test="competitionType != null">competition_type = #{competitionType},</if>
<if test="competitionTime != null">competition_time = #{competitionTime},</if>
<if test="buildingId != null">building_id = #{buildingId},</if>
<if test="buildingName != null">building_name = #{buildingName},</if>
<if test="competitionAddress != null">competition_address = #{competitionAddress},</if>
<if test="founder != null">founder = #{founder},</if>
<if test="status != null">status = #{status},</if>
<if test="cityCode != null">city_code = #{cityCode},</if>
<if test="cityName != null">city_name = #{cityName},</if>
<if test="maxPlayer != null">max_player = #{maxPlayer},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="lastUpdatedTime != null">last_updated_time = #{lastUpdatedTime},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="modifiedBy != null">modified_by = #{modifiedBy},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="competitionNature != null">competition_nature = #{competitionNature},</if>
<if test="enrollBeginTime != null">enroll_begin_time = #{enrollBeginTime},</if>
<if test="enrollEndTime != null">enroll_end_time = #{enrollEndTime},</if>
<if test="contacts != null">contacts = #{contacts},</if>
<if test="contactsAreaCode != null">contacts_area_code = #{contactsAreaCode},</if>
<if test="contactsTel != null">contacts_tel = #{contactsTel},</if>
<if test="competitionBeginTime != null">competition_begin_time = #{competitionBeginTime},</if>
<if test="competitionEndTime != null">competition_end_time = #{competitionEndTime},</if>
<if test="organizer != null">organizer = #{organizer},</if>
<if test="undertake != null">undertake = #{undertake},</if>
<if test="competitionBackImg != null">competition_back_img = #{competitionBackImg},</if>
<if test="createdId != null">created_id = #{createdId},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="heightHide != null">height_hide = #{heightHide},</if>
<if test="sponsor != null">sponsor = #{sponsor},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCompetitionById" parameterType="Long">
delete from competition where id = #{id}
</delete>
<delete id="deleteCompetitionByIds" parameterType="String">
delete from competition where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>