mybatis-generator 逆向生成工具(实体、dao、sql)
介紹:
mybatis-generator?是一個(gè)逆向生成工具,用于將數(shù)據(jù)庫(kù)表逆向生成實(shí)體對(duì)象(entity),持久層Dao接口以及用于操作數(shù)據(jù)庫(kù)的sql語(yǔ)句xml文件。對(duì)于簡(jiǎn)單的單表操作,增刪改查幾乎不用動(dòng)手寫(xiě)任額外的代碼。因?yàn)檫@些都已經(jīng)通過(guò)逆向工程自動(dòng)生成了,所以幫我們省了一大攤子事兒。
項(xiàng)目結(jié)構(gòu)如下:
下面簡(jiǎn)單介紹其使用和配置方式:
數(shù)據(jù)庫(kù)連接配置:
jdbc.driverLocation=tool/mysql-connector-java-5.1.12.jar jdbc.driverClassName=com.mysql.jdbc.Driver #測(cè)試環(huán)境 jdbc.url=jdbc:mysql://10.0.2.30:3306/xsignal2_test?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=true&zeroDateTimeBehavior=convertToNull jdbc.username=root jdbc.password=cloud2逆向生成相關(guān)配置:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration><!--導(dǎo)入屬性配置 --><properties resource="generator.properties"></properties><!--指定特定數(shù)據(jù)庫(kù)的jdbc驅(qū)動(dòng)jar包的位置 --><!--<classPathEntry location="tool/mysql-connector-java-5.1.12.jar"/>--><classPathEntry location="${jdbc.driverLocation}"/><context id="default" targetRuntime="MyBatis3"><!--toString方法插件--><plugin type="org.mybatis.generator.plugins.ToStringPlugin"/><!--序列化插件--><plugin type="org.mybatis.generator.plugins.SerializablePlugin"/><!--生成equals方法插件--><plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"/><!--替換后綴插件,Mapper替換為dao--><!--<plugin type="org.mybatis.generator.plugins.RenameExampleClassPlugin"><property name="searchString" value="$Mapper"/><property name="replaceString"value="Dao"/></plugin>--><!--分頁(yè)插件--><plugin type="com.xiaofeng.generator.plugin.ModelExampleLimitPlugin"/><commentGenerator type="com.xiaofeng.generator.plugin.CommentGenerator"><property name="suppressDate" value="true"/><property name="suppressAllComments" value="true"/></commentGenerator><!--jdbc的數(shù)據(jù)庫(kù)連接 --><!--<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://10.0.2.30:3306/xsignal2_test"userId="root"password="cloud2"></jdbcConnection>--><!-- 數(shù)據(jù)庫(kù)連接 --><jdbcConnection driverClass="${jdbc.driverClassName}" connectionURL="${jdbc.url}"userId="${jdbc.username}"password="${jdbc.password}"/><!-- 非必需,類型處理器,在數(shù)據(jù)庫(kù)類型和java類型之間的轉(zhuǎn)換控制--><javaTypeResolver><property name="forceBigDecimals" value="false"/></javaTypeResolver><!-- Model模型生成器,用來(lái)生成含有主鍵key的類,記錄類 以及查詢Example類targetPackage 指定生成的model生成所在的包名targetProject 指定在該項(xiàng)目下所在的路徑--><javaModelGenerator targetPackage="com.xiaofeng.generator.model"targetProject="src/main/java"><property name="enableSubPackages" value="true"/><property name="trimStrings" value="true"/></javaModelGenerator><!--Mapper映射文件生成所在的目錄 為每一個(gè)數(shù)據(jù)庫(kù)的表生成對(duì)應(yīng)的SqlMap文件 --><sqlMapGenerator targetPackage="sqlmap"targetProject="src/main/resources"><property name="enableSubPackages" value="true"/></sqlMapGenerator><!-- 客戶端代碼,生成易于使用的針對(duì)Model對(duì)象和XML配置文件 的代碼type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper對(duì)象type="MIXEDMAPPER",生成基于注解的Java Model 和相應(yīng)的Mapper對(duì)象type="XMLMAPPER",生成SQLMap XML文件和獨(dú)立的Mapper接口--><javaClientGenerator targetPackage="com.xiaofeng.generator.mapper"targetProject="src/main/java" type="XMLMAPPER"><!-- XMLMAPPER,SPRING --><property name="enableSubPackages" value="true"/></javaClientGenerator><!--此處設(shè)置需要生成的表--><table tableName="tb_company_activity_info"domainObjectName="CompanyActivityInfo"><property name="useActualColumnNames" value="false"/></table></context> </generatorConfiguration>實(shí)體注釋插件:
package com.xiaofeng.generator.plugin;import org.mybatis.generator.api.IntrospectedColumn; import org.mybatis.generator.api.IntrospectedTable; import org.mybatis.generator.api.dom.java.Field; import org.mybatis.generator.internal.DefaultCommentGenerator;/*** @author xiaofeng* @version V1.0* @title: CommentGenerator* @package: com.xiaofeng.generator.plugin* @description: 生成model中,字段增加注釋* @date 2019/9/11 18:07*/ public class CommentGenerator extends DefaultCommentGenerator {@Overridepublic void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {super.addFieldComment(field, introspectedTable, introspectedColumn);if (introspectedColumn.getRemarks() != null && !introspectedColumn.getRemarks().equals("")) {field.addJavaDocLine("/**");field.addJavaDocLine(" * " + introspectedColumn.getRemarks());addJavadocTag(field, false);field.addJavaDocLine(" */");}}}分頁(yè)相關(guān)插件:
package com.xiaofeng.generator.plugin;import org.mybatis.generator.api.IntrospectedTable; import org.mybatis.generator.api.PluginAdapter; import org.mybatis.generator.api.ShellRunner; import org.mybatis.generator.api.dom.java.*; import org.mybatis.generator.api.dom.xml.Attribute; import org.mybatis.generator.api.dom.xml.Element; import org.mybatis.generator.api.dom.xml.TextElement; import org.mybatis.generator.api.dom.xml.XmlElement;import java.util.List;public class ModelExampleLimitPlugin extends PluginAdapter {private String limitTypeString = "com.xiaofeng.generator.plugin.Limit";@Overridepublic boolean validate(List<String> arg0) {return true;}@Overridepublic boolean modelExampleClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {FullyQualifiedJavaType limitType = new FullyQualifiedJavaType(limitTypeString);topLevelClass.addImportedType(limitType);Field field = new Field();field.setName("limit");field.setType(limitType);field.setVisibility(JavaVisibility.PRIVATE);topLevelClass.addField(field);Method setMethod = new Method();setMethod.setName("setLimit");setMethod.setVisibility(JavaVisibility.PUBLIC);setMethod.addParameter(new Parameter(limitType, "limit"));setMethod.addBodyLine("this.limit = limit;");topLevelClass.addMethod(setMethod);Method getMethod = new Method();getMethod.setName("getLimit");getMethod.setVisibility(JavaVisibility.PUBLIC);getMethod.setReturnType(limitType);getMethod.addBodyLine("return this.limit;");topLevelClass.addMethod(getMethod);return true;}@Overridepublic boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element,IntrospectedTable introspectedTable) {addLimitSqlMapCode(element);return true;}@Overridepublic boolean sqlMapSelectByExampleWithBLOBsElementGenerated(XmlElement element,IntrospectedTable introspectedTable) {List<Element> elementList = element.getElements();XmlElement orderByElement = (XmlElement) elementList.get(elementList.size() - 1);orderByElement.getElements().set(0, new TextElement("order by ${orderByClause}"));addLimitSqlMapCode(element);return true;}private void addLimitSqlMapCode(XmlElement element) {XmlElement limit = new XmlElement("if");limit.addAttribute(new Attribute("test", "limit != null"));limit.addElement(new TextElement("limit #{limit.start},#{limit.maxRows}"));element.addElement(limit);}public static void main(String[] args) {String config= ModelExampleLimitPlugin.class.getClassLoader().getResource("/tool/generatorConfig.xml").getFile();String[] arg= { "-configfile", config, "-overwrite"};ShellRunner.main(arg);} } package com.xiaofeng.generator.plugin;public class Limit {private int start = 0;private int maxRows = -1;public Limit(int start) {this.start = start;}public Limit(int start, int maxRows) {this.start = start;this.maxRows = maxRows;}public int getStart() {return start;}public void setStart(int start) {this.start = start;}public int getMaxRows() {return maxRows;}public void setMaxRows(int maxRows) {this.maxRows = maxRows;}}執(zhí)行命令生成:
clean install mybatis-generator:generate -e生成后的效果如圖(包含實(shí)體類,Mapper(dao)接口,xml文件(封裝sql語(yǔ)句)):
生成的實(shí)體類如下:
package com.xiaofeng.generator.model;import java.io.Serializable; import java.util.Date;public class CompanyActivityInfo implements Serializable {/*** 活動(dòng)ID** @mbg.generated*/private Long id;/*** 企業(yè)ID** @mbg.generated*/private Long companyId;/*** 活動(dòng)類型** @mbg.generated*/private String activityType;/*** 活動(dòng)名稱** @mbg.generated*/private String activityName;/*** 報(bào)名開(kāi)始時(shí)間** @mbg.generated*/private Date applyStartTime;/*** 報(bào)名結(jié)束時(shí)間** @mbg.generated*/private Date applyEndTime;/*** 比賽開(kāi)始時(shí)間** @mbg.generated*/private Date competitionStartTime;/*** 比賽結(jié)束時(shí)間** @mbg.generated*/private Date competitionEndTime;/*** 0未發(fā)布 1未開(kāi)始 2進(jìn)行中 3已結(jié)束** @mbg.generated*/private Byte status;/*** 報(bào)名人數(shù)** @mbg.generated*/private Long applicant;/*** 參賽人數(shù)** @mbg.generated*/private Long participant;/*** 虛擬人數(shù)** @mbg.generated*/private Long virtual;/*** 1展示 0隱藏** @mbg.generated*/private Byte isShow;/*** 限制人數(shù) -1不限制** @mbg.generated*/private Long maxPlayers;/*** 背景圖** @mbg.generated*/private String backdrop;/*** 活動(dòng)鏈接** @mbg.generated*/private String activityLink;/*** 風(fēng)險(xiǎn)及免責(zé)條款** @mbg.generated*/private String riskAndDisclaimer;/*** 創(chuàng)建人** @mbg.generated*/private String createBy;/*** 創(chuàng)建時(shí)間** @mbg.generated*/private Date createTime;/*** 修改人** @mbg.generated*/private String updateBy;/*** 修改時(shí)間** @mbg.generated*/private Date updateTime;/*** 0未刪除 1已刪除** @mbg.generated*/private Byte remove;/*** 展示字段(逗號(hào)隔開(kāi))** @mbg.generated*/private String viewField;/*** 比賽須知** @mbg.generated*/private String competitionNotice;private static final long serialVersionUID = 1L;public Long getId() {return id;}public void setId(Long id) {this.id = id;}public Long getCompanyId() {return companyId;}public void setCompanyId(Long companyId) {this.companyId = companyId;}public String getActivityType() {return activityType;}public void setActivityType(String activityType) {this.activityType = activityType == null ? null : activityType.trim();}public String getActivityName() {return activityName;}public void setActivityName(String activityName) {this.activityName = activityName == null ? null : activityName.trim();}public Date getApplyStartTime() {return applyStartTime;}public void setApplyStartTime(Date applyStartTime) {this.applyStartTime = applyStartTime;}public Date getApplyEndTime() {return applyEndTime;}public void setApplyEndTime(Date applyEndTime) {this.applyEndTime = applyEndTime;}public Date getCompetitionStartTime() {return competitionStartTime;}public void setCompetitionStartTime(Date competitionStartTime) {this.competitionStartTime = competitionStartTime;}public Date getCompetitionEndTime() {return competitionEndTime;}public void setCompetitionEndTime(Date competitionEndTime) {this.competitionEndTime = competitionEndTime;}public Byte getStatus() {return status;}public void setStatus(Byte status) {this.status = status;}public Long getApplicant() {return applicant;}public void setApplicant(Long applicant) {this.applicant = applicant;}public Long getParticipant() {return participant;}public void setParticipant(Long participant) {this.participant = participant;}public Long getVirtual() {return virtual;}public void setVirtual(Long virtual) {this.virtual = virtual;}public Byte getIsShow() {return isShow;}public void setIsShow(Byte isShow) {this.isShow = isShow;}public Long getMaxPlayers() {return maxPlayers;}public void setMaxPlayers(Long maxPlayers) {this.maxPlayers = maxPlayers;}public String getBackdrop() {return backdrop;}public void setBackdrop(String backdrop) {this.backdrop = backdrop == null ? null : backdrop.trim();}public String getActivityLink() {return activityLink;}public void setActivityLink(String activityLink) {this.activityLink = activityLink == null ? null : activityLink.trim();}public String getRiskAndDisclaimer() {return riskAndDisclaimer;}public void setRiskAndDisclaimer(String riskAndDisclaimer) {this.riskAndDisclaimer = riskAndDisclaimer == null ? null : riskAndDisclaimer.trim();}public String getCreateBy() {return createBy;}public void setCreateBy(String createBy) {this.createBy = createBy == null ? null : createBy.trim();}public Date getCreateTime() {return createTime;}public void setCreateTime(Date createTime) {this.createTime = createTime;}public String getUpdateBy() {return updateBy;}public void setUpdateBy(String updateBy) {this.updateBy = updateBy == null ? null : updateBy.trim();}public Date getUpdateTime() {return updateTime;}public void setUpdateTime(Date updateTime) {this.updateTime = updateTime;}public Byte getRemove() {return remove;}public void setRemove(Byte remove) {this.remove = remove;}public String getViewField() {return viewField;}public void setViewField(String viewField) {this.viewField = viewField == null ? null : viewField.trim();}public String getCompetitionNotice() {return competitionNotice;}public void setCompetitionNotice(String competitionNotice) {this.competitionNotice = competitionNotice == null ? null : competitionNotice.trim();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder();sb.append(getClass().getSimpleName());sb.append(" [");sb.append("Hash = ").append(hashCode());sb.append(", id=").append(id);sb.append(", companyId=").append(companyId);sb.append(", activityType=").append(activityType);sb.append(", activityName=").append(activityName);sb.append(", applyStartTime=").append(applyStartTime);sb.append(", applyEndTime=").append(applyEndTime);sb.append(", competitionStartTime=").append(competitionStartTime);sb.append(", competitionEndTime=").append(competitionEndTime);sb.append(", status=").append(status);sb.append(", applicant=").append(applicant);sb.append(", participant=").append(participant);sb.append(", virtual=").append(virtual);sb.append(", isShow=").append(isShow);sb.append(", maxPlayers=").append(maxPlayers);sb.append(", backdrop=").append(backdrop);sb.append(", activityLink=").append(activityLink);sb.append(", riskAndDisclaimer=").append(riskAndDisclaimer);sb.append(", createBy=").append(createBy);sb.append(", createTime=").append(createTime);sb.append(", updateBy=").append(updateBy);sb.append(", updateTime=").append(updateTime);sb.append(", remove=").append(remove);sb.append(", viewField=").append(viewField);sb.append(", competitionNotice=").append(competitionNotice);sb.append("]");return sb.toString();}@Overridepublic boolean equals(Object that) {if (this == that) {return true;}if (that == null) {return false;}if (getClass() != that.getClass()) {return false;}CompanyActivityInfo other = (CompanyActivityInfo) that;return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))&& (this.getActivityType() == null ? other.getActivityType() == null : this.getActivityType().equals(other.getActivityType()))&& (this.getActivityName() == null ? other.getActivityName() == null : this.getActivityName().equals(other.getActivityName()))&& (this.getApplyStartTime() == null ? other.getApplyStartTime() == null : this.getApplyStartTime().equals(other.getApplyStartTime()))&& (this.getApplyEndTime() == null ? other.getApplyEndTime() == null : this.getApplyEndTime().equals(other.getApplyEndTime()))&& (this.getCompetitionStartTime() == null ? other.getCompetitionStartTime() == null : this.getCompetitionStartTime().equals(other.getCompetitionStartTime()))&& (this.getCompetitionEndTime() == null ? other.getCompetitionEndTime() == null : this.getCompetitionEndTime().equals(other.getCompetitionEndTime()))&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))&& (this.getApplicant() == null ? other.getApplicant() == null : this.getApplicant().equals(other.getApplicant()))&& (this.getParticipant() == null ? other.getParticipant() == null : this.getParticipant().equals(other.getParticipant()))&& (this.getVirtual() == null ? other.getVirtual() == null : this.getVirtual().equals(other.getVirtual()))&& (this.getIsShow() == null ? other.getIsShow() == null : this.getIsShow().equals(other.getIsShow()))&& (this.getMaxPlayers() == null ? other.getMaxPlayers() == null : this.getMaxPlayers().equals(other.getMaxPlayers()))&& (this.getBackdrop() == null ? other.getBackdrop() == null : this.getBackdrop().equals(other.getBackdrop()))&& (this.getActivityLink() == null ? other.getActivityLink() == null : this.getActivityLink().equals(other.getActivityLink()))&& (this.getRiskAndDisclaimer() == null ? other.getRiskAndDisclaimer() == null : this.getRiskAndDisclaimer().equals(other.getRiskAndDisclaimer()))&& (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))&& (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))&& (this.getRemove() == null ? other.getRemove() == null : this.getRemove().equals(other.getRemove()))&& (this.getViewField() == null ? other.getViewField() == null : this.getViewField().equals(other.getViewField()))&& (this.getCompetitionNotice() == null ? other.getCompetitionNotice() == null : this.getCompetitionNotice().equals(other.getCompetitionNotice()));}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + ((getId() == null) ? 0 : getId().hashCode());result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());result = prime * result + ((getActivityType() == null) ? 0 : getActivityType().hashCode());result = prime * result + ((getActivityName() == null) ? 0 : getActivityName().hashCode());result = prime * result + ((getApplyStartTime() == null) ? 0 : getApplyStartTime().hashCode());result = prime * result + ((getApplyEndTime() == null) ? 0 : getApplyEndTime().hashCode());result = prime * result + ((getCompetitionStartTime() == null) ? 0 : getCompetitionStartTime().hashCode());result = prime * result + ((getCompetitionEndTime() == null) ? 0 : getCompetitionEndTime().hashCode());result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());result = prime * result + ((getApplicant() == null) ? 0 : getApplicant().hashCode());result = prime * result + ((getParticipant() == null) ? 0 : getParticipant().hashCode());result = prime * result + ((getVirtual() == null) ? 0 : getVirtual().hashCode());result = prime * result + ((getIsShow() == null) ? 0 : getIsShow().hashCode());result = prime * result + ((getMaxPlayers() == null) ? 0 : getMaxPlayers().hashCode());result = prime * result + ((getBackdrop() == null) ? 0 : getBackdrop().hashCode());result = prime * result + ((getActivityLink() == null) ? 0 : getActivityLink().hashCode());result = prime * result + ((getRiskAndDisclaimer() == null) ? 0 : getRiskAndDisclaimer().hashCode());result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());result = prime * result + ((getRemove() == null) ? 0 : getRemove().hashCode());result = prime * result + ((getViewField() == null) ? 0 : getViewField().hashCode());result = prime * result + ((getCompetitionNotice() == null) ? 0 : getCompetitionNotice().hashCode());return result;} }生成的example類如下(此類封裝了所有查詢條件,通過(guò)函數(shù)式的風(fēng)格可以加入大部分你需要的查詢條件):
package com.xiaofeng.generator.model;import com.xiaofeng.generator.plugin.Limit; import java.util.ArrayList; import java.util.Date; import java.util.List;public class CompanyActivityInfoExample {protected String orderByClause;protected boolean distinct;protected List<Criteria> oredCriteria;private Limit limit;public CompanyActivityInfoExample() {oredCriteria = new ArrayList<Criteria>();}public void setOrderByClause(String orderByClause) {this.orderByClause = orderByClause;}public String getOrderByClause() {return orderByClause;}public void setDistinct(boolean distinct) {this.distinct = distinct;}public boolean isDistinct() {return distinct;}public List<Criteria> getOredCriteria() {return oredCriteria;}public void or(Criteria criteria) {oredCriteria.add(criteria);}public Criteria or() {Criteria criteria = createCriteriaInternal();oredCriteria.add(criteria);return criteria;}public Criteria createCriteria() {Criteria criteria = createCriteriaInternal();if (oredCriteria.size() == 0) {oredCriteria.add(criteria);}return criteria;}protected Criteria createCriteriaInternal() {Criteria criteria = new Criteria();return criteria;}public void clear() {oredCriteria.clear();orderByClause = null;distinct = false;}public void setLimit(Limit limit) {this.limit = limit;}public Limit getLimit() {return this.limit;}protected abstract static class GeneratedCriteria {protected List<Criterion> criteria;protected GeneratedCriteria() {super();criteria = new ArrayList<Criterion>();}public boolean isValid() {return criteria.size() > 0;}public List<Criterion> getAllCriteria() {return criteria;}public List<Criterion> getCriteria() {return criteria;}protected void addCriterion(String condition) {if (condition == null) {throw new RuntimeException("Value for condition cannot be null");}criteria.add(new Criterion(condition));}protected void addCriterion(String condition, Object value, String property) {if (value == null) {throw new RuntimeException("Value for " + property + " cannot be null");}criteria.add(new Criterion(condition, value));}protected void addCriterion(String condition, Object value1, Object value2, String property) {if (value1 == null || value2 == null) {throw new RuntimeException("Between values for " + property + " cannot be null");}criteria.add(new Criterion(condition, value1, value2));}public Criteria andIdIsNull() {addCriterion("id is null");return (Criteria) this;}public Criteria andIdIsNotNull() {addCriterion("id is not null");return (Criteria) this;}public Criteria andIdEqualTo(Long value) {addCriterion("id =", value, "id");return (Criteria) this;}public Criteria andIdNotEqualTo(Long value) {addCriterion("id <>", value, "id");return (Criteria) this;}public Criteria andIdGreaterThan(Long value) {addCriterion("id >", value, "id");return (Criteria) this;}public Criteria andIdGreaterThanOrEqualTo(Long value) {addCriterion("id >=", value, "id");return (Criteria) this;}public Criteria andIdLessThan(Long value) {addCriterion("id <", value, "id");return (Criteria) this;}public Criteria andIdLessThanOrEqualTo(Long value) {addCriterion("id <=", value, "id");return (Criteria) this;}public Criteria andIdIn(List<Long> values) {addCriterion("id in", values, "id");return (Criteria) this;}public Criteria andIdNotIn(List<Long> values) {addCriterion("id not in", values, "id");return (Criteria) this;}public Criteria andIdBetween(Long value1, Long value2) {addCriterion("id between", value1, value2, "id");return (Criteria) this;}public Criteria andIdNotBetween(Long value1, Long value2) {addCriterion("id not between", value1, value2, "id");return (Criteria) this;}public Criteria andCompanyIdIsNull() {addCriterion("company_id is null");return (Criteria) this;}public Criteria andCompanyIdIsNotNull() {addCriterion("company_id is not null");return (Criteria) this;}public Criteria andCompanyIdEqualTo(Long value) {addCriterion("company_id =", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdNotEqualTo(Long value) {addCriterion("company_id <>", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdGreaterThan(Long value) {addCriterion("company_id >", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {addCriterion("company_id >=", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdLessThan(Long value) {addCriterion("company_id <", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdLessThanOrEqualTo(Long value) {addCriterion("company_id <=", value, "companyId");return (Criteria) this;}public Criteria andCompanyIdIn(List<Long> values) {addCriterion("company_id in", values, "companyId");return (Criteria) this;}public Criteria andCompanyIdNotIn(List<Long> values) {addCriterion("company_id not in", values, "companyId");return (Criteria) this;}public Criteria andCompanyIdBetween(Long value1, Long value2) {addCriterion("company_id between", value1, value2, "companyId");return (Criteria) this;}public Criteria andCompanyIdNotBetween(Long value1, Long value2) {addCriterion("company_id not between", value1, value2, "companyId");return (Criteria) this;}public Criteria andActivityTypeIsNull() {addCriterion("activity_type is null");return (Criteria) this;}public Criteria andActivityTypeIsNotNull() {addCriterion("activity_type is not null");return (Criteria) this;}public Criteria andActivityTypeEqualTo(String value) {addCriterion("activity_type =", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeNotEqualTo(String value) {addCriterion("activity_type <>", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeGreaterThan(String value) {addCriterion("activity_type >", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeGreaterThanOrEqualTo(String value) {addCriterion("activity_type >=", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeLessThan(String value) {addCriterion("activity_type <", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeLessThanOrEqualTo(String value) {addCriterion("activity_type <=", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeLike(String value) {addCriterion("activity_type like", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeNotLike(String value) {addCriterion("activity_type not like", value, "activityType");return (Criteria) this;}public Criteria andActivityTypeIn(List<String> values) {addCriterion("activity_type in", values, "activityType");return (Criteria) this;}public Criteria andActivityTypeNotIn(List<String> values) {addCriterion("activity_type not in", values, "activityType");return (Criteria) this;}public Criteria andActivityTypeBetween(String value1, String value2) {addCriterion("activity_type between", value1, value2, "activityType");return (Criteria) this;}public Criteria andActivityTypeNotBetween(String value1, String value2) {addCriterion("activity_type not between", value1, value2, "activityType");return (Criteria) this;}public Criteria andActivityNameIsNull() {addCriterion("activity_name is null");return (Criteria) this;}public Criteria andActivityNameIsNotNull() {addCriterion("activity_name is not null");return (Criteria) this;}public Criteria andActivityNameEqualTo(String value) {addCriterion("activity_name =", value, "activityName");return (Criteria) this;}public Criteria andActivityNameNotEqualTo(String value) {addCriterion("activity_name <>", value, "activityName");return (Criteria) this;}public Criteria andActivityNameGreaterThan(String value) {addCriterion("activity_name >", value, "activityName");return (Criteria) this;}public Criteria andActivityNameGreaterThanOrEqualTo(String value) {addCriterion("activity_name >=", value, "activityName");return (Criteria) this;}public Criteria andActivityNameLessThan(String value) {addCriterion("activity_name <", value, "activityName");return (Criteria) this;}public Criteria andActivityNameLessThanOrEqualTo(String value) {addCriterion("activity_name <=", value, "activityName");return (Criteria) this;}public Criteria andActivityNameLike(String value) {addCriterion("activity_name like", value, "activityName");return (Criteria) this;}public Criteria andActivityNameNotLike(String value) {addCriterion("activity_name not like", value, "activityName");return (Criteria) this;}public Criteria andActivityNameIn(List<String> values) {addCriterion("activity_name in", values, "activityName");return (Criteria) this;}public Criteria andActivityNameNotIn(List<String> values) {addCriterion("activity_name not in", values, "activityName");return (Criteria) this;}public Criteria andActivityNameBetween(String value1, String value2) {addCriterion("activity_name between", value1, value2, "activityName");return (Criteria) this;}public Criteria andActivityNameNotBetween(String value1, String value2) {addCriterion("activity_name not between", value1, value2, "activityName");return (Criteria) this;}public Criteria andApplyStartTimeIsNull() {addCriterion("apply_start_time is null");return (Criteria) this;}public Criteria andApplyStartTimeIsNotNull() {addCriterion("apply_start_time is not null");return (Criteria) this;}public Criteria andApplyStartTimeEqualTo(Date value) {addCriterion("apply_start_time =", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeNotEqualTo(Date value) {addCriterion("apply_start_time <>", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeGreaterThan(Date value) {addCriterion("apply_start_time >", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeGreaterThanOrEqualTo(Date value) {addCriterion("apply_start_time >=", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeLessThan(Date value) {addCriterion("apply_start_time <", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeLessThanOrEqualTo(Date value) {addCriterion("apply_start_time <=", value, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeIn(List<Date> values) {addCriterion("apply_start_time in", values, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeNotIn(List<Date> values) {addCriterion("apply_start_time not in", values, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeBetween(Date value1, Date value2) {addCriterion("apply_start_time between", value1, value2, "applyStartTime");return (Criteria) this;}public Criteria andApplyStartTimeNotBetween(Date value1, Date value2) {addCriterion("apply_start_time not between", value1, value2, "applyStartTime");return (Criteria) this;}public Criteria andApplyEndTimeIsNull() {addCriterion("apply_end_time is null");return (Criteria) this;}public Criteria andApplyEndTimeIsNotNull() {addCriterion("apply_end_time is not null");return (Criteria) this;}public Criteria andApplyEndTimeEqualTo(Date value) {addCriterion("apply_end_time =", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeNotEqualTo(Date value) {addCriterion("apply_end_time <>", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeGreaterThan(Date value) {addCriterion("apply_end_time >", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeGreaterThanOrEqualTo(Date value) {addCriterion("apply_end_time >=", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeLessThan(Date value) {addCriterion("apply_end_time <", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeLessThanOrEqualTo(Date value) {addCriterion("apply_end_time <=", value, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeIn(List<Date> values) {addCriterion("apply_end_time in", values, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeNotIn(List<Date> values) {addCriterion("apply_end_time not in", values, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeBetween(Date value1, Date value2) {addCriterion("apply_end_time between", value1, value2, "applyEndTime");return (Criteria) this;}public Criteria andApplyEndTimeNotBetween(Date value1, Date value2) {addCriterion("apply_end_time not between", value1, value2, "applyEndTime");return (Criteria) this;}public Criteria andCompetitionStartTimeIsNull() {addCriterion("competition_start_time is null");return (Criteria) this;}public Criteria andCompetitionStartTimeIsNotNull() {addCriterion("competition_start_time is not null");return (Criteria) this;}public Criteria andCompetitionStartTimeEqualTo(Date value) {addCriterion("competition_start_time =", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeNotEqualTo(Date value) {addCriterion("competition_start_time <>", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeGreaterThan(Date value) {addCriterion("competition_start_time >", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeGreaterThanOrEqualTo(Date value) {addCriterion("competition_start_time >=", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeLessThan(Date value) {addCriterion("competition_start_time <", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeLessThanOrEqualTo(Date value) {addCriterion("competition_start_time <=", value, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeIn(List<Date> values) {addCriterion("competition_start_time in", values, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeNotIn(List<Date> values) {addCriterion("competition_start_time not in", values, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeBetween(Date value1, Date value2) {addCriterion("competition_start_time between", value1, value2, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionStartTimeNotBetween(Date value1, Date value2) {addCriterion("competition_start_time not between", value1, value2, "competitionStartTime");return (Criteria) this;}public Criteria andCompetitionEndTimeIsNull() {addCriterion("competition_end_time is null");return (Criteria) this;}public Criteria andCompetitionEndTimeIsNotNull() {addCriterion("competition_end_time is not null");return (Criteria) this;}public Criteria andCompetitionEndTimeEqualTo(Date value) {addCriterion("competition_end_time =", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeNotEqualTo(Date value) {addCriterion("competition_end_time <>", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeGreaterThan(Date value) {addCriterion("competition_end_time >", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeGreaterThanOrEqualTo(Date value) {addCriterion("competition_end_time >=", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeLessThan(Date value) {addCriterion("competition_end_time <", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeLessThanOrEqualTo(Date value) {addCriterion("competition_end_time <=", value, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeIn(List<Date> values) {addCriterion("competition_end_time in", values, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeNotIn(List<Date> values) {addCriterion("competition_end_time not in", values, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeBetween(Date value1, Date value2) {addCriterion("competition_end_time between", value1, value2, "competitionEndTime");return (Criteria) this;}public Criteria andCompetitionEndTimeNotBetween(Date value1, Date value2) {addCriterion("competition_end_time not between", value1, value2, "competitionEndTime");return (Criteria) this;}public Criteria andStatusIsNull() {addCriterion("status is null");return (Criteria) this;}public Criteria andStatusIsNotNull() {addCriterion("status is not null");return (Criteria) this;}public Criteria andStatusEqualTo(Byte value) {addCriterion("status =", value, "status");return (Criteria) this;}public Criteria andStatusNotEqualTo(Byte value) {addCriterion("status <>", value, "status");return (Criteria) this;}public Criteria andStatusGreaterThan(Byte value) {addCriterion("status >", value, "status");return (Criteria) this;}public Criteria andStatusGreaterThanOrEqualTo(Byte value) {addCriterion("status >=", value, "status");return (Criteria) this;}public Criteria andStatusLessThan(Byte value) {addCriterion("status <", value, "status");return (Criteria) this;}public Criteria andStatusLessThanOrEqualTo(Byte value) {addCriterion("status <=", value, "status");return (Criteria) this;}public Criteria andStatusIn(List<Byte> values) {addCriterion("status in", values, "status");return (Criteria) this;}public Criteria andStatusNotIn(List<Byte> values) {addCriterion("status not in", values, "status");return (Criteria) this;}public Criteria andStatusBetween(Byte value1, Byte value2) {addCriterion("status between", value1, value2, "status");return (Criteria) this;}public Criteria andStatusNotBetween(Byte value1, Byte value2) {addCriterion("status not between", value1, value2, "status");return (Criteria) this;}public Criteria andApplicantIsNull() {addCriterion("applicant is null");return (Criteria) this;}public Criteria andApplicantIsNotNull() {addCriterion("applicant is not null");return (Criteria) this;}public Criteria andApplicantEqualTo(Long value) {addCriterion("applicant =", value, "applicant");return (Criteria) this;}public Criteria andApplicantNotEqualTo(Long value) {addCriterion("applicant <>", value, "applicant");return (Criteria) this;}public Criteria andApplicantGreaterThan(Long value) {addCriterion("applicant >", value, "applicant");return (Criteria) this;}public Criteria andApplicantGreaterThanOrEqualTo(Long value) {addCriterion("applicant >=", value, "applicant");return (Criteria) this;}public Criteria andApplicantLessThan(Long value) {addCriterion("applicant <", value, "applicant");return (Criteria) this;}public Criteria andApplicantLessThanOrEqualTo(Long value) {addCriterion("applicant <=", value, "applicant");return (Criteria) this;}public Criteria andApplicantIn(List<Long> values) {addCriterion("applicant in", values, "applicant");return (Criteria) this;}public Criteria andApplicantNotIn(List<Long> values) {addCriterion("applicant not in", values, "applicant");return (Criteria) this;}public Criteria andApplicantBetween(Long value1, Long value2) {addCriterion("applicant between", value1, value2, "applicant");return (Criteria) this;}public Criteria andApplicantNotBetween(Long value1, Long value2) {addCriterion("applicant not between", value1, value2, "applicant");return (Criteria) this;}public Criteria andParticipantIsNull() {addCriterion("participant is null");return (Criteria) this;}public Criteria andParticipantIsNotNull() {addCriterion("participant is not null");return (Criteria) this;}public Criteria andParticipantEqualTo(Long value) {addCriterion("participant =", value, "participant");return (Criteria) this;}public Criteria andParticipantNotEqualTo(Long value) {addCriterion("participant <>", value, "participant");return (Criteria) this;}public Criteria andParticipantGreaterThan(Long value) {addCriterion("participant >", value, "participant");return (Criteria) this;}public Criteria andParticipantGreaterThanOrEqualTo(Long value) {addCriterion("participant >=", value, "participant");return (Criteria) this;}public Criteria andParticipantLessThan(Long value) {addCriterion("participant <", value, "participant");return (Criteria) this;}public Criteria andParticipantLessThanOrEqualTo(Long value) {addCriterion("participant <=", value, "participant");return (Criteria) this;}public Criteria andParticipantIn(List<Long> values) {addCriterion("participant in", values, "participant");return (Criteria) this;}public Criteria andParticipantNotIn(List<Long> values) {addCriterion("participant not in", values, "participant");return (Criteria) this;}public Criteria andParticipantBetween(Long value1, Long value2) {addCriterion("participant between", value1, value2, "participant");return (Criteria) this;}public Criteria andParticipantNotBetween(Long value1, Long value2) {addCriterion("participant not between", value1, value2, "participant");return (Criteria) this;}public Criteria andVirtualIsNull() {addCriterion("virtual is null");return (Criteria) this;}public Criteria andVirtualIsNotNull() {addCriterion("virtual is not null");return (Criteria) this;}public Criteria andVirtualEqualTo(Long value) {addCriterion("virtual =", value, "virtual");return (Criteria) this;}public Criteria andVirtualNotEqualTo(Long value) {addCriterion("virtual <>", value, "virtual");return (Criteria) this;}public Criteria andVirtualGreaterThan(Long value) {addCriterion("virtual >", value, "virtual");return (Criteria) this;}public Criteria andVirtualGreaterThanOrEqualTo(Long value) {addCriterion("virtual >=", value, "virtual");return (Criteria) this;}public Criteria andVirtualLessThan(Long value) {addCriterion("virtual <", value, "virtual");return (Criteria) this;}public Criteria andVirtualLessThanOrEqualTo(Long value) {addCriterion("virtual <=", value, "virtual");return (Criteria) this;}public Criteria andVirtualIn(List<Long> values) {addCriterion("virtual in", values, "virtual");return (Criteria) this;}public Criteria andVirtualNotIn(List<Long> values) {addCriterion("virtual not in", values, "virtual");return (Criteria) this;}public Criteria andVirtualBetween(Long value1, Long value2) {addCriterion("virtual between", value1, value2, "virtual");return (Criteria) this;}public Criteria andVirtualNotBetween(Long value1, Long value2) {addCriterion("virtual not between", value1, value2, "virtual");return (Criteria) this;}public Criteria andIsShowIsNull() {addCriterion("is_show is null");return (Criteria) this;}public Criteria andIsShowIsNotNull() {addCriterion("is_show is not null");return (Criteria) this;}public Criteria andIsShowEqualTo(Byte value) {addCriterion("is_show =", value, "isShow");return (Criteria) this;}public Criteria andIsShowNotEqualTo(Byte value) {addCriterion("is_show <>", value, "isShow");return (Criteria) this;}public Criteria andIsShowGreaterThan(Byte value) {addCriterion("is_show >", value, "isShow");return (Criteria) this;}public Criteria andIsShowGreaterThanOrEqualTo(Byte value) {addCriterion("is_show >=", value, "isShow");return (Criteria) this;}public Criteria andIsShowLessThan(Byte value) {addCriterion("is_show <", value, "isShow");return (Criteria) this;}public Criteria andIsShowLessThanOrEqualTo(Byte value) {addCriterion("is_show <=", value, "isShow");return (Criteria) this;}public Criteria andIsShowIn(List<Byte> values) {addCriterion("is_show in", values, "isShow");return (Criteria) this;}public Criteria andIsShowNotIn(List<Byte> values) {addCriterion("is_show not in", values, "isShow");return (Criteria) this;}public Criteria andIsShowBetween(Byte value1, Byte value2) {addCriterion("is_show between", value1, value2, "isShow");return (Criteria) this;}public Criteria andIsShowNotBetween(Byte value1, Byte value2) {addCriterion("is_show not between", value1, value2, "isShow");return (Criteria) this;}public Criteria andMaxPlayersIsNull() {addCriterion("max_players is null");return (Criteria) this;}public Criteria andMaxPlayersIsNotNull() {addCriterion("max_players is not null");return (Criteria) this;}public Criteria andMaxPlayersEqualTo(Long value) {addCriterion("max_players =", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersNotEqualTo(Long value) {addCriterion("max_players <>", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersGreaterThan(Long value) {addCriterion("max_players >", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersGreaterThanOrEqualTo(Long value) {addCriterion("max_players >=", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersLessThan(Long value) {addCriterion("max_players <", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersLessThanOrEqualTo(Long value) {addCriterion("max_players <=", value, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersIn(List<Long> values) {addCriterion("max_players in", values, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersNotIn(List<Long> values) {addCriterion("max_players not in", values, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersBetween(Long value1, Long value2) {addCriterion("max_players between", value1, value2, "maxPlayers");return (Criteria) this;}public Criteria andMaxPlayersNotBetween(Long value1, Long value2) {addCriterion("max_players not between", value1, value2, "maxPlayers");return (Criteria) this;}public Criteria andBackdropIsNull() {addCriterion("backdrop is null");return (Criteria) this;}public Criteria andBackdropIsNotNull() {addCriterion("backdrop is not null");return (Criteria) this;}public Criteria andBackdropEqualTo(String value) {addCriterion("backdrop =", value, "backdrop");return (Criteria) this;}public Criteria andBackdropNotEqualTo(String value) {addCriterion("backdrop <>", value, "backdrop");return (Criteria) this;}public Criteria andBackdropGreaterThan(String value) {addCriterion("backdrop >", value, "backdrop");return (Criteria) this;}public Criteria andBackdropGreaterThanOrEqualTo(String value) {addCriterion("backdrop >=", value, "backdrop");return (Criteria) this;}public Criteria andBackdropLessThan(String value) {addCriterion("backdrop <", value, "backdrop");return (Criteria) this;}public Criteria andBackdropLessThanOrEqualTo(String value) {addCriterion("backdrop <=", value, "backdrop");return (Criteria) this;}public Criteria andBackdropLike(String value) {addCriterion("backdrop like", value, "backdrop");return (Criteria) this;}public Criteria andBackdropNotLike(String value) {addCriterion("backdrop not like", value, "backdrop");return (Criteria) this;}public Criteria andBackdropIn(List<String> values) {addCriterion("backdrop in", values, "backdrop");return (Criteria) this;}public Criteria andBackdropNotIn(List<String> values) {addCriterion("backdrop not in", values, "backdrop");return (Criteria) this;}public Criteria andBackdropBetween(String value1, String value2) {addCriterion("backdrop between", value1, value2, "backdrop");return (Criteria) this;}public Criteria andBackdropNotBetween(String value1, String value2) {addCriterion("backdrop not between", value1, value2, "backdrop");return (Criteria) this;}public Criteria andActivityLinkIsNull() {addCriterion("activity_link is null");return (Criteria) this;}public Criteria andActivityLinkIsNotNull() {addCriterion("activity_link is not null");return (Criteria) this;}public Criteria andActivityLinkEqualTo(String value) {addCriterion("activity_link =", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkNotEqualTo(String value) {addCriterion("activity_link <>", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkGreaterThan(String value) {addCriterion("activity_link >", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkGreaterThanOrEqualTo(String value) {addCriterion("activity_link >=", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkLessThan(String value) {addCriterion("activity_link <", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkLessThanOrEqualTo(String value) {addCriterion("activity_link <=", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkLike(String value) {addCriterion("activity_link like", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkNotLike(String value) {addCriterion("activity_link not like", value, "activityLink");return (Criteria) this;}public Criteria andActivityLinkIn(List<String> values) {addCriterion("activity_link in", values, "activityLink");return (Criteria) this;}public Criteria andActivityLinkNotIn(List<String> values) {addCriterion("activity_link not in", values, "activityLink");return (Criteria) this;}public Criteria andActivityLinkBetween(String value1, String value2) {addCriterion("activity_link between", value1, value2, "activityLink");return (Criteria) this;}public Criteria andActivityLinkNotBetween(String value1, String value2) {addCriterion("activity_link not between", value1, value2, "activityLink");return (Criteria) this;}public Criteria andRiskAndDisclaimerIsNull() {addCriterion("risk_and_disclaimer is null");return (Criteria) this;}public Criteria andRiskAndDisclaimerIsNotNull() {addCriterion("risk_and_disclaimer is not null");return (Criteria) this;}public Criteria andRiskAndDisclaimerEqualTo(String value) {addCriterion("risk_and_disclaimer =", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerNotEqualTo(String value) {addCriterion("risk_and_disclaimer <>", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerGreaterThan(String value) {addCriterion("risk_and_disclaimer >", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerGreaterThanOrEqualTo(String value) {addCriterion("risk_and_disclaimer >=", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerLessThan(String value) {addCriterion("risk_and_disclaimer <", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerLessThanOrEqualTo(String value) {addCriterion("risk_and_disclaimer <=", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerLike(String value) {addCriterion("risk_and_disclaimer like", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerNotLike(String value) {addCriterion("risk_and_disclaimer not like", value, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerIn(List<String> values) {addCriterion("risk_and_disclaimer in", values, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerNotIn(List<String> values) {addCriterion("risk_and_disclaimer not in", values, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerBetween(String value1, String value2) {addCriterion("risk_and_disclaimer between", value1, value2, "riskAndDisclaimer");return (Criteria) this;}public Criteria andRiskAndDisclaimerNotBetween(String value1, String value2) {addCriterion("risk_and_disclaimer not between", value1, value2, "riskAndDisclaimer");return (Criteria) this;}public Criteria andCreateByIsNull() {addCriterion("create_by is null");return (Criteria) this;}public Criteria andCreateByIsNotNull() {addCriterion("create_by is not null");return (Criteria) this;}public Criteria andCreateByEqualTo(String value) {addCriterion("create_by =", value, "createBy");return (Criteria) this;}public Criteria andCreateByNotEqualTo(String value) {addCriterion("create_by <>", value, "createBy");return (Criteria) this;}public Criteria andCreateByGreaterThan(String value) {addCriterion("create_by >", value, "createBy");return (Criteria) this;}public Criteria andCreateByGreaterThanOrEqualTo(String value) {addCriterion("create_by >=", value, "createBy");return (Criteria) this;}public Criteria andCreateByLessThan(String value) {addCriterion("create_by <", value, "createBy");return (Criteria) this;}public Criteria andCreateByLessThanOrEqualTo(String value) {addCriterion("create_by <=", value, "createBy");return (Criteria) this;}public Criteria andCreateByLike(String value) {addCriterion("create_by like", value, "createBy");return (Criteria) this;}public Criteria andCreateByNotLike(String value) {addCriterion("create_by not like", value, "createBy");return (Criteria) this;}public Criteria andCreateByIn(List<String> values) {addCriterion("create_by in", values, "createBy");return (Criteria) this;}public Criteria andCreateByNotIn(List<String> values) {addCriterion("create_by not in", values, "createBy");return (Criteria) this;}public Criteria andCreateByBetween(String value1, String value2) {addCriterion("create_by between", value1, value2, "createBy");return (Criteria) this;}public Criteria andCreateByNotBetween(String value1, String value2) {addCriterion("create_by not between", value1, value2, "createBy");return (Criteria) this;}public Criteria andCreateTimeIsNull() {addCriterion("create_time is null");return (Criteria) this;}public Criteria andCreateTimeIsNotNull() {addCriterion("create_time is not null");return (Criteria) this;}public Criteria andCreateTimeEqualTo(Date value) {addCriterion("create_time =", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeNotEqualTo(Date value) {addCriterion("create_time <>", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeGreaterThan(Date value) {addCriterion("create_time >", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {addCriterion("create_time >=", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeLessThan(Date value) {addCriterion("create_time <", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeLessThanOrEqualTo(Date value) {addCriterion("create_time <=", value, "createTime");return (Criteria) this;}public Criteria andCreateTimeIn(List<Date> values) {addCriterion("create_time in", values, "createTime");return (Criteria) this;}public Criteria andCreateTimeNotIn(List<Date> values) {addCriterion("create_time not in", values, "createTime");return (Criteria) this;}public Criteria andCreateTimeBetween(Date value1, Date value2) {addCriterion("create_time between", value1, value2, "createTime");return (Criteria) this;}public Criteria andCreateTimeNotBetween(Date value1, Date value2) {addCriterion("create_time not between", value1, value2, "createTime");return (Criteria) this;}public Criteria andUpdateByIsNull() {addCriterion("update_by is null");return (Criteria) this;}public Criteria andUpdateByIsNotNull() {addCriterion("update_by is not null");return (Criteria) this;}public Criteria andUpdateByEqualTo(String value) {addCriterion("update_by =", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByNotEqualTo(String value) {addCriterion("update_by <>", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByGreaterThan(String value) {addCriterion("update_by >", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByGreaterThanOrEqualTo(String value) {addCriterion("update_by >=", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByLessThan(String value) {addCriterion("update_by <", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByLessThanOrEqualTo(String value) {addCriterion("update_by <=", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByLike(String value) {addCriterion("update_by like", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByNotLike(String value) {addCriterion("update_by not like", value, "updateBy");return (Criteria) this;}public Criteria andUpdateByIn(List<String> values) {addCriterion("update_by in", values, "updateBy");return (Criteria) this;}public Criteria andUpdateByNotIn(List<String> values) {addCriterion("update_by not in", values, "updateBy");return (Criteria) this;}public Criteria andUpdateByBetween(String value1, String value2) {addCriterion("update_by between", value1, value2, "updateBy");return (Criteria) this;}public Criteria andUpdateByNotBetween(String value1, String value2) {addCriterion("update_by not between", value1, value2, "updateBy");return (Criteria) this;}public Criteria andUpdateTimeIsNull() {addCriterion("update_time is null");return (Criteria) this;}public Criteria andUpdateTimeIsNotNull() {addCriterion("update_time is not null");return (Criteria) this;}public Criteria andUpdateTimeEqualTo(Date value) {addCriterion("update_time =", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeNotEqualTo(Date value) {addCriterion("update_time <>", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeGreaterThan(Date value) {addCriterion("update_time >", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {addCriterion("update_time >=", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeLessThan(Date value) {addCriterion("update_time <", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {addCriterion("update_time <=", value, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeIn(List<Date> values) {addCriterion("update_time in", values, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeNotIn(List<Date> values) {addCriterion("update_time not in", values, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeBetween(Date value1, Date value2) {addCriterion("update_time between", value1, value2, "updateTime");return (Criteria) this;}public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {addCriterion("update_time not between", value1, value2, "updateTime");return (Criteria) this;}public Criteria andRemoveIsNull() {addCriterion("remove is null");return (Criteria) this;}public Criteria andRemoveIsNotNull() {addCriterion("remove is not null");return (Criteria) this;}public Criteria andRemoveEqualTo(Byte value) {addCriterion("remove =", value, "remove");return (Criteria) this;}public Criteria andRemoveNotEqualTo(Byte value) {addCriterion("remove <>", value, "remove");return (Criteria) this;}public Criteria andRemoveGreaterThan(Byte value) {addCriterion("remove >", value, "remove");return (Criteria) this;}public Criteria andRemoveGreaterThanOrEqualTo(Byte value) {addCriterion("remove >=", value, "remove");return (Criteria) this;}public Criteria andRemoveLessThan(Byte value) {addCriterion("remove <", value, "remove");return (Criteria) this;}public Criteria andRemoveLessThanOrEqualTo(Byte value) {addCriterion("remove <=", value, "remove");return (Criteria) this;}public Criteria andRemoveIn(List<Byte> values) {addCriterion("remove in", values, "remove");return (Criteria) this;}public Criteria andRemoveNotIn(List<Byte> values) {addCriterion("remove not in", values, "remove");return (Criteria) this;}public Criteria andRemoveBetween(Byte value1, Byte value2) {addCriterion("remove between", value1, value2, "remove");return (Criteria) this;}public Criteria andRemoveNotBetween(Byte value1, Byte value2) {addCriterion("remove not between", value1, value2, "remove");return (Criteria) this;}public Criteria andViewFieldIsNull() {addCriterion("view_field is null");return (Criteria) this;}public Criteria andViewFieldIsNotNull() {addCriterion("view_field is not null");return (Criteria) this;}public Criteria andViewFieldEqualTo(String value) {addCriterion("view_field =", value, "viewField");return (Criteria) this;}public Criteria andViewFieldNotEqualTo(String value) {addCriterion("view_field <>", value, "viewField");return (Criteria) this;}public Criteria andViewFieldGreaterThan(String value) {addCriterion("view_field >", value, "viewField");return (Criteria) this;}public Criteria andViewFieldGreaterThanOrEqualTo(String value) {addCriterion("view_field >=", value, "viewField");return (Criteria) this;}public Criteria andViewFieldLessThan(String value) {addCriterion("view_field <", value, "viewField");return (Criteria) this;}public Criteria andViewFieldLessThanOrEqualTo(String value) {addCriterion("view_field <=", value, "viewField");return (Criteria) this;}public Criteria andViewFieldLike(String value) {addCriterion("view_field like", value, "viewField");return (Criteria) this;}public Criteria andViewFieldNotLike(String value) {addCriterion("view_field not like", value, "viewField");return (Criteria) this;}public Criteria andViewFieldIn(List<String> values) {addCriterion("view_field in", values, "viewField");return (Criteria) this;}public Criteria andViewFieldNotIn(List<String> values) {addCriterion("view_field not in", values, "viewField");return (Criteria) this;}public Criteria andViewFieldBetween(String value1, String value2) {addCriterion("view_field between", value1, value2, "viewField");return (Criteria) this;}public Criteria andViewFieldNotBetween(String value1, String value2) {addCriterion("view_field not between", value1, value2, "viewField");return (Criteria) this;}}public static class Criteria extends GeneratedCriteria {protected Criteria() {super();}}public static class Criterion {private String condition;private Object value;private Object secondValue;private boolean noValue;private boolean singleValue;private boolean betweenValue;private boolean listValue;private String typeHandler;public String getCondition() {return condition;}public Object getValue() {return value;}public Object getSecondValue() {return secondValue;}public boolean isNoValue() {return noValue;}public boolean isSingleValue() {return singleValue;}public boolean isBetweenValue() {return betweenValue;}public boolean isListValue() {return listValue;}public String getTypeHandler() {return typeHandler;}protected Criterion(String condition) {super();this.condition = condition;this.typeHandler = null;this.noValue = true;}protected Criterion(String condition, Object value, String typeHandler) {super();this.condition = condition;this.value = value;this.typeHandler = typeHandler;if (value instanceof List<?>) {this.listValue = true;} else {this.singleValue = true;}}protected Criterion(String condition, Object value) {this(condition, value, null);}protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {super();this.condition = condition;this.value = value;this.secondValue = secondValue;this.typeHandler = typeHandler;this.betweenValue = true;}protected Criterion(String condition, Object value, Object secondValue) {this(condition, value, secondValue, null);}} }mapper(dao)接口如下(幾乎涵蓋了所有單表的操作方法):
package com.xiaofeng.generator.mapper;import com.xiaofeng.generator.model.CompanyActivityInfo; import com.xiaofeng.generator.model.CompanyActivityInfoExample; import java.util.List; import org.apache.ibatis.annotations.Param;public interface CompanyActivityInfoMapper {long countByExample(CompanyActivityInfoExample example);int deleteByExample(CompanyActivityInfoExample example);int deleteByPrimaryKey(Long id);int insert(CompanyActivityInfo record);int insertSelective(CompanyActivityInfo record);List<CompanyActivityInfo> selectByExampleWithBLOBs(CompanyActivityInfoExample example);List<CompanyActivityInfo> selectByExample(CompanyActivityInfoExample example);CompanyActivityInfo selectByPrimaryKey(Long id);int updateByExampleSelective(@Param("record") CompanyActivityInfo record, @Param("example") CompanyActivityInfoExample example);int updateByExampleWithBLOBs(@Param("record") CompanyActivityInfo record, @Param("example") CompanyActivityInfoExample example);int updateByExample(@Param("record") CompanyActivityInfo record, @Param("example") CompanyActivityInfoExample example);int updateByPrimaryKeySelective(CompanyActivityInfo record);int updateByPrimaryKeyWithBLOBs(CompanyActivityInfo record);int updateByPrimaryKey(CompanyActivityInfo record); }mapper.xml文件如下(用于操作 sql,幾乎所有單表操作的sql你都不用寫(xiě)了,直接調(diào)用即可):
<?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.xiaofeng.generator.mapper.CompanyActivityInfoMapper"><resultMap id="BaseResultMap" type="com.xiaofeng.generator.model.CompanyActivityInfo"><id column="id" jdbcType="BIGINT" property="id" /><result column="company_id" jdbcType="BIGINT" property="companyId" /><result column="activity_type" jdbcType="VARCHAR" property="activityType" /><result column="activity_name" jdbcType="VARCHAR" property="activityName" /><result column="apply_start_time" jdbcType="TIMESTAMP" property="applyStartTime" /><result column="apply_end_time" jdbcType="TIMESTAMP" property="applyEndTime" /><result column="competition_start_time" jdbcType="TIMESTAMP" property="competitionStartTime" /><result column="competition_end_time" jdbcType="TIMESTAMP" property="competitionEndTime" /><result column="status" jdbcType="TINYINT" property="status" /><result column="applicant" jdbcType="BIGINT" property="applicant" /><result column="participant" jdbcType="BIGINT" property="participant" /><result column="virtual" jdbcType="BIGINT" property="virtual" /><result column="is_show" jdbcType="TINYINT" property="isShow" /><result column="max_players" jdbcType="BIGINT" property="maxPlayers" /><result column="backdrop" jdbcType="VARCHAR" property="backdrop" /><result column="activity_link" jdbcType="VARCHAR" property="activityLink" /><result column="risk_and_disclaimer" jdbcType="VARCHAR" property="riskAndDisclaimer" /><result column="create_by" jdbcType="VARCHAR" property="createBy" /><result column="create_time" jdbcType="TIMESTAMP" property="createTime" /><result column="update_by" jdbcType="VARCHAR" property="updateBy" /><result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /><result column="remove" jdbcType="TINYINT" property="remove" /><result column="view_field" jdbcType="VARCHAR" property="viewField" /></resultMap><resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.xiaofeng.generator.model.CompanyActivityInfo"><result column="competition_notice" jdbcType="LONGVARCHAR" property="competitionNotice" /></resultMap><sql id="Example_Where_Clause"><where><foreach collection="oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Update_By_Example_Where_Clause"><where><foreach collection="example.oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Base_Column_List">id, company_id, activity_type, activity_name, apply_start_time, apply_end_time, competition_start_time, competition_end_time, status, applicant, participant, virtual, is_show, max_players, backdrop, activity_link, risk_and_disclaimer, create_by, create_time, update_by, update_time, remove, view_field</sql><sql id="Blob_Column_List">competition_notice</sql><select id="selectByExampleWithBLOBs" parameterType="com.xiaofeng.generator.model.CompanyActivityInfoExample" resultMap="ResultMapWithBLOBs">select<if test="distinct">distinct</if><include refid="Base_Column_List" />,<include refid="Blob_Column_List" />from tb_company_activity_info<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if><if test="limit != null">limit #{limit.start},#{limit.maxRows}</if></select><select id="selectByExample" parameterType="com.xiaofeng.generator.model.CompanyActivityInfoExample" resultMap="BaseResultMap">select<if test="distinct">distinct</if><include refid="Base_Column_List" />from tb_company_activity_info<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if><if test="limit != null">limit #{limit.start},#{limit.maxRows}</if></select><select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">select <include refid="Base_Column_List" />,<include refid="Blob_Column_List" />from tb_company_activity_infowhere id = #{id,jdbcType=BIGINT}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from tb_company_activity_infowhere id = #{id,jdbcType=BIGINT}</delete><delete id="deleteByExample" parameterType="com.xiaofeng.generator.model.CompanyActivityInfoExample">delete from tb_company_activity_info<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></delete><insert id="insert" parameterType="com.xiaofeng.generator.model.CompanyActivityInfo">insert into tb_company_activity_info (id, company_id, activity_type, activity_name, apply_start_time, apply_end_time, competition_start_time, competition_end_time, status, applicant, participant, virtual, is_show, max_players, backdrop, activity_link, risk_and_disclaimer, create_by, create_time, update_by, update_time, remove, view_field, competition_notice)values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{activityType,jdbcType=VARCHAR}, #{activityName,jdbcType=VARCHAR}, #{applyStartTime,jdbcType=TIMESTAMP}, #{applyEndTime,jdbcType=TIMESTAMP}, #{competitionStartTime,jdbcType=TIMESTAMP}, #{competitionEndTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, #{applicant,jdbcType=BIGINT}, #{participant,jdbcType=BIGINT}, #{virtual,jdbcType=BIGINT}, #{isShow,jdbcType=TINYINT}, #{maxPlayers,jdbcType=BIGINT}, #{backdrop,jdbcType=VARCHAR}, #{activityLink,jdbcType=VARCHAR}, #{riskAndDisclaimer,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{remove,jdbcType=TINYINT}, #{viewField,jdbcType=VARCHAR}, #{competitionNotice,jdbcType=LONGVARCHAR})</insert><insert id="insertSelective" parameterType="com.xiaofeng.generator.model.CompanyActivityInfo">insert into tb_company_activity_info<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if><if test="companyId != null">company_id,</if><if test="activityType != null">activity_type,</if><if test="activityName != null">activity_name,</if><if test="applyStartTime != null">apply_start_time,</if><if test="applyEndTime != null">apply_end_time,</if><if test="competitionStartTime != null">competition_start_time,</if><if test="competitionEndTime != null">competition_end_time,</if><if test="status != null">status,</if><if test="applicant != null">applicant,</if><if test="participant != null">participant,</if><if test="virtual != null">virtual,</if><if test="isShow != null">is_show,</if><if test="maxPlayers != null">max_players,</if><if test="backdrop != null">backdrop,</if><if test="activityLink != null">activity_link,</if><if test="riskAndDisclaimer != null">risk_and_disclaimer,</if><if test="createBy != null">create_by,</if><if test="createTime != null">create_time,</if><if test="updateBy != null">update_by,</if><if test="updateTime != null">update_time,</if><if test="remove != null">remove,</if><if test="viewField != null">view_field,</if><if test="competitionNotice != null">competition_notice,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="id != null">#{id,jdbcType=BIGINT},</if><if test="companyId != null">#{companyId,jdbcType=BIGINT},</if><if test="activityType != null">#{activityType,jdbcType=VARCHAR},</if><if test="activityName != null">#{activityName,jdbcType=VARCHAR},</if><if test="applyStartTime != null">#{applyStartTime,jdbcType=TIMESTAMP},</if><if test="applyEndTime != null">#{applyEndTime,jdbcType=TIMESTAMP},</if><if test="competitionStartTime != null">#{competitionStartTime,jdbcType=TIMESTAMP},</if><if test="competitionEndTime != null">#{competitionEndTime,jdbcType=TIMESTAMP},</if><if test="status != null">#{status,jdbcType=TINYINT},</if><if test="applicant != null">#{applicant,jdbcType=BIGINT},</if><if test="participant != null">#{participant,jdbcType=BIGINT},</if><if test="virtual != null">#{virtual,jdbcType=BIGINT},</if><if test="isShow != null">#{isShow,jdbcType=TINYINT},</if><if test="maxPlayers != null">#{maxPlayers,jdbcType=BIGINT},</if><if test="backdrop != null">#{backdrop,jdbcType=VARCHAR},</if><if test="activityLink != null">#{activityLink,jdbcType=VARCHAR},</if><if test="riskAndDisclaimer != null">#{riskAndDisclaimer,jdbcType=VARCHAR},</if><if test="createBy != null">#{createBy,jdbcType=VARCHAR},</if><if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if><if test="updateBy != null">#{updateBy,jdbcType=VARCHAR},</if><if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if><if test="remove != null">#{remove,jdbcType=TINYINT},</if><if test="viewField != null">#{viewField,jdbcType=VARCHAR},</if><if test="competitionNotice != null">#{competitionNotice,jdbcType=LONGVARCHAR},</if></trim></insert><select id="countByExample" parameterType="com.xiaofeng.generator.model.CompanyActivityInfoExample" resultType="java.lang.Long">select count(*) from tb_company_activity_info<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></select><update id="updateByExampleSelective" parameterType="map">update tb_company_activity_info<set><if test="record.id != null">id = #{record.id,jdbcType=BIGINT},</if><if test="record.companyId != null">company_id = #{record.companyId,jdbcType=BIGINT},</if><if test="record.activityType != null">activity_type = #{record.activityType,jdbcType=VARCHAR},</if><if test="record.activityName != null">activity_name = #{record.activityName,jdbcType=VARCHAR},</if><if test="record.applyStartTime != null">apply_start_time = #{record.applyStartTime,jdbcType=TIMESTAMP},</if><if test="record.applyEndTime != null">apply_end_time = #{record.applyEndTime,jdbcType=TIMESTAMP},</if><if test="record.competitionStartTime != null">competition_start_time = #{record.competitionStartTime,jdbcType=TIMESTAMP},</if><if test="record.competitionEndTime != null">competition_end_time = #{record.competitionEndTime,jdbcType=TIMESTAMP},</if><if test="record.status != null">status = #{record.status,jdbcType=TINYINT},</if><if test="record.applicant != null">applicant = #{record.applicant,jdbcType=BIGINT},</if><if test="record.participant != null">participant = #{record.participant,jdbcType=BIGINT},</if><if test="record.virtual != null">virtual = #{record.virtual,jdbcType=BIGINT},</if><if test="record.isShow != null">is_show = #{record.isShow,jdbcType=TINYINT},</if><if test="record.maxPlayers != null">max_players = #{record.maxPlayers,jdbcType=BIGINT},</if><if test="record.backdrop != null">backdrop = #{record.backdrop,jdbcType=VARCHAR},</if><if test="record.activityLink != null">activity_link = #{record.activityLink,jdbcType=VARCHAR},</if><if test="record.riskAndDisclaimer != null">risk_and_disclaimer = #{record.riskAndDisclaimer,jdbcType=VARCHAR},</if><if test="record.createBy != null">create_by = #{record.createBy,jdbcType=VARCHAR},</if><if test="record.createTime != null">create_time = #{record.createTime,jdbcType=TIMESTAMP},</if><if test="record.updateBy != null">update_by = #{record.updateBy,jdbcType=VARCHAR},</if><if test="record.updateTime != null">update_time = #{record.updateTime,jdbcType=TIMESTAMP},</if><if test="record.remove != null">remove = #{record.remove,jdbcType=TINYINT},</if><if test="record.viewField != null">view_field = #{record.viewField,jdbcType=VARCHAR},</if><if test="record.competitionNotice != null">competition_notice = #{record.competitionNotice,jdbcType=LONGVARCHAR},</if></set><if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByExampleWithBLOBs" parameterType="map">update tb_company_activity_infoset id = #{record.id,jdbcType=BIGINT},company_id = #{record.companyId,jdbcType=BIGINT},activity_type = #{record.activityType,jdbcType=VARCHAR},activity_name = #{record.activityName,jdbcType=VARCHAR},apply_start_time = #{record.applyStartTime,jdbcType=TIMESTAMP},apply_end_time = #{record.applyEndTime,jdbcType=TIMESTAMP},competition_start_time = #{record.competitionStartTime,jdbcType=TIMESTAMP},competition_end_time = #{record.competitionEndTime,jdbcType=TIMESTAMP},status = #{record.status,jdbcType=TINYINT},applicant = #{record.applicant,jdbcType=BIGINT},participant = #{record.participant,jdbcType=BIGINT},virtual = #{record.virtual,jdbcType=BIGINT},is_show = #{record.isShow,jdbcType=TINYINT},max_players = #{record.maxPlayers,jdbcType=BIGINT},backdrop = #{record.backdrop,jdbcType=VARCHAR},activity_link = #{record.activityLink,jdbcType=VARCHAR},risk_and_disclaimer = #{record.riskAndDisclaimer,jdbcType=VARCHAR},create_by = #{record.createBy,jdbcType=VARCHAR},create_time = #{record.createTime,jdbcType=TIMESTAMP},update_by = #{record.updateBy,jdbcType=VARCHAR},update_time = #{record.updateTime,jdbcType=TIMESTAMP},remove = #{record.remove,jdbcType=TINYINT},view_field = #{record.viewField,jdbcType=VARCHAR},competition_notice = #{record.competitionNotice,jdbcType=LONGVARCHAR}<if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByExample" parameterType="map">update tb_company_activity_infoset id = #{record.id,jdbcType=BIGINT},company_id = #{record.companyId,jdbcType=BIGINT},activity_type = #{record.activityType,jdbcType=VARCHAR},activity_name = #{record.activityName,jdbcType=VARCHAR},apply_start_time = #{record.applyStartTime,jdbcType=TIMESTAMP},apply_end_time = #{record.applyEndTime,jdbcType=TIMESTAMP},competition_start_time = #{record.competitionStartTime,jdbcType=TIMESTAMP},competition_end_time = #{record.competitionEndTime,jdbcType=TIMESTAMP},status = #{record.status,jdbcType=TINYINT},applicant = #{record.applicant,jdbcType=BIGINT},participant = #{record.participant,jdbcType=BIGINT},virtual = #{record.virtual,jdbcType=BIGINT},is_show = #{record.isShow,jdbcType=TINYINT},max_players = #{record.maxPlayers,jdbcType=BIGINT},backdrop = #{record.backdrop,jdbcType=VARCHAR},activity_link = #{record.activityLink,jdbcType=VARCHAR},risk_and_disclaimer = #{record.riskAndDisclaimer,jdbcType=VARCHAR},create_by = #{record.createBy,jdbcType=VARCHAR},create_time = #{record.createTime,jdbcType=TIMESTAMP},update_by = #{record.updateBy,jdbcType=VARCHAR},update_time = #{record.updateTime,jdbcType=TIMESTAMP},remove = #{record.remove,jdbcType=TINYINT},view_field = #{record.viewField,jdbcType=VARCHAR}<if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByPrimaryKeySelective" parameterType="com.xiaofeng.generator.model.CompanyActivityInfo">update tb_company_activity_info<set><if test="companyId != null">company_id = #{companyId,jdbcType=BIGINT},</if><if test="activityType != null">activity_type = #{activityType,jdbcType=VARCHAR},</if><if test="activityName != null">activity_name = #{activityName,jdbcType=VARCHAR},</if><if test="applyStartTime != null">apply_start_time = #{applyStartTime,jdbcType=TIMESTAMP},</if><if test="applyEndTime != null">apply_end_time = #{applyEndTime,jdbcType=TIMESTAMP},</if><if test="competitionStartTime != null">competition_start_time = #{competitionStartTime,jdbcType=TIMESTAMP},</if><if test="competitionEndTime != null">competition_end_time = #{competitionEndTime,jdbcType=TIMESTAMP},</if><if test="status != null">status = #{status,jdbcType=TINYINT},</if><if test="applicant != null">applicant = #{applicant,jdbcType=BIGINT},</if><if test="participant != null">participant = #{participant,jdbcType=BIGINT},</if><if test="virtual != null">virtual = #{virtual,jdbcType=BIGINT},</if><if test="isShow != null">is_show = #{isShow,jdbcType=TINYINT},</if><if test="maxPlayers != null">max_players = #{maxPlayers,jdbcType=BIGINT},</if><if test="backdrop != null">backdrop = #{backdrop,jdbcType=VARCHAR},</if><if test="activityLink != null">activity_link = #{activityLink,jdbcType=VARCHAR},</if><if test="riskAndDisclaimer != null">risk_and_disclaimer = #{riskAndDisclaimer,jdbcType=VARCHAR},</if><if test="createBy != null">create_by = #{createBy,jdbcType=VARCHAR},</if><if test="createTime != null">create_time = #{createTime,jdbcType=TIMESTAMP},</if><if test="updateBy != null">update_by = #{updateBy,jdbcType=VARCHAR},</if><if test="updateTime != null">update_time = #{updateTime,jdbcType=TIMESTAMP},</if><if test="remove != null">remove = #{remove,jdbcType=TINYINT},</if><if test="viewField != null">view_field = #{viewField,jdbcType=VARCHAR},</if><if test="competitionNotice != null">competition_notice = #{competitionNotice,jdbcType=LONGVARCHAR},</if></set>where id = #{id,jdbcType=BIGINT}</update><update id="updateByPrimaryKeyWithBLOBs" parameterType="com.xiaofeng.generator.model.CompanyActivityInfo">update tb_company_activity_infoset company_id = #{companyId,jdbcType=BIGINT},activity_type = #{activityType,jdbcType=VARCHAR},activity_name = #{activityName,jdbcType=VARCHAR},apply_start_time = #{applyStartTime,jdbcType=TIMESTAMP},apply_end_time = #{applyEndTime,jdbcType=TIMESTAMP},competition_start_time = #{competitionStartTime,jdbcType=TIMESTAMP},competition_end_time = #{competitionEndTime,jdbcType=TIMESTAMP},status = #{status,jdbcType=TINYINT},applicant = #{applicant,jdbcType=BIGINT},participant = #{participant,jdbcType=BIGINT},virtual = #{virtual,jdbcType=BIGINT},is_show = #{isShow,jdbcType=TINYINT},max_players = #{maxPlayers,jdbcType=BIGINT},backdrop = #{backdrop,jdbcType=VARCHAR},activity_link = #{activityLink,jdbcType=VARCHAR},risk_and_disclaimer = #{riskAndDisclaimer,jdbcType=VARCHAR},create_by = #{createBy,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},update_by = #{updateBy,jdbcType=VARCHAR},update_time = #{updateTime,jdbcType=TIMESTAMP},remove = #{remove,jdbcType=TINYINT},view_field = #{viewField,jdbcType=VARCHAR},competition_notice = #{competitionNotice,jdbcType=LONGVARCHAR}where id = #{id,jdbcType=BIGINT}</update><update id="updateByPrimaryKey" parameterType="com.xiaofeng.generator.model.CompanyActivityInfo">update tb_company_activity_infoset company_id = #{companyId,jdbcType=BIGINT},activity_type = #{activityType,jdbcType=VARCHAR},activity_name = #{activityName,jdbcType=VARCHAR},apply_start_time = #{applyStartTime,jdbcType=TIMESTAMP},apply_end_time = #{applyEndTime,jdbcType=TIMESTAMP},competition_start_time = #{competitionStartTime,jdbcType=TIMESTAMP},competition_end_time = #{competitionEndTime,jdbcType=TIMESTAMP},status = #{status,jdbcType=TINYINT},applicant = #{applicant,jdbcType=BIGINT},participant = #{participant,jdbcType=BIGINT},virtual = #{virtual,jdbcType=BIGINT},is_show = #{isShow,jdbcType=TINYINT},max_players = #{maxPlayers,jdbcType=BIGINT},backdrop = #{backdrop,jdbcType=VARCHAR},activity_link = #{activityLink,jdbcType=VARCHAR},risk_and_disclaimer = #{riskAndDisclaimer,jdbcType=VARCHAR},create_by = #{createBy,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},update_by = #{updateBy,jdbcType=VARCHAR},update_time = #{updateTime,jdbcType=TIMESTAMP},remove = #{remove,jdbcType=TINYINT},view_field = #{viewField,jdbcType=VARCHAR}where id = #{id,jdbcType=BIGINT}</update> </mapper>?
完整可運(yùn)行源碼下載地址:http://zyshare.cn/resource/detail/11
總結(jié)
以上是生活随笔為你收集整理的mybatis-generator 逆向生成工具(实体、dao、sql)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 最小满月遇上元宵夜 元宵节到底是吃汤圆还
- 下一篇: HBuilder、HBuilderX连接