├── lib ├── ojdbc14.jar ├── log4j-1.2.16.jar ├── mybatis-3.4.2.jar ├── mybatis-generator-core-1.3.5.jar └── mysql-connector-java-5.1.28-bin.jar ├── src ├── log4j.properties ├── cn │ └── ssm │ │ └── core │ │ ├── dao │ │ ├── dept │ │ │ ├── DeptDao.java │ │ │ └── DeptDao.xml │ │ └── emp │ │ │ ├── E2EmpDao.java │ │ │ ├── EmpEmpDao.java │ │ │ ├── SalgradeempDao.java │ │ │ ├── E2EmpDao.xml │ │ │ ├── SalgradeempDao.xml │ │ │ └── EmpEmpDao.xml │ │ └── bean │ │ ├── emp │ │ ├── E2Emp.java │ │ ├── Salgradeemp.java │ │ ├── EmpEmp.java │ │ ├── E2EmpQuery.java │ │ ├── SalgradeempQuery.java │ │ └── EmpEmpQuery.java │ │ └── dept │ │ ├── Dept.java │ │ └── DeptQuery.java ├── GeneratorSqlmap.java └── org │ └── mybatis │ └── generator │ └── plugins │ ├── rename │ ├── RenameJavaMapperPlugin.java │ └── RenameSqlMapperPlugin.java │ ├── table │ └── TkMyBatis3Impl.java │ ├── comment │ └── MyCommentGenerator.java │ ├── field │ └── FieldsPlugin.java │ └── page │ └── PaginationPlugin.java └── generatorConfig.xml /lib/ojdbc14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bnhjk76/mybatisGenerator/HEAD/lib/ojdbc14.jar -------------------------------------------------------------------------------- /lib/log4j-1.2.16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bnhjk76/mybatisGenerator/HEAD/lib/log4j-1.2.16.jar -------------------------------------------------------------------------------- /lib/mybatis-3.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bnhjk76/mybatisGenerator/HEAD/lib/mybatis-3.4.2.jar -------------------------------------------------------------------------------- /lib/mybatis-generator-core-1.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bnhjk76/mybatisGenerator/HEAD/lib/mybatis-generator-core-1.3.5.jar -------------------------------------------------------------------------------- /lib/mysql-connector-java-5.1.28-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bnhjk76/mybatisGenerator/HEAD/lib/mysql-connector-java-5.1.28-bin.jar -------------------------------------------------------------------------------- /src/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, Console 2 | #Console 3 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n 6 | log4j.logger.java.sql.ResultSet=INFO 7 | log4j.logger.org.apache=INFO 8 | log4j.logger.java.sql.Connection=DEBUG 9 | log4j.logger.java.sql.Statement=DEBUG 10 | log4j.logger.java.sql.PreparedStatement=DEBUG -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/dept/DeptDao.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.dao.dept; 2 | 3 | import cn.ssm.core.bean.dept.Dept; 4 | import cn.ssm.core.bean.dept.DeptQuery; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface DeptDao { 9 | long countByExample(DeptQuery example); 10 | 11 | int deleteByExample(DeptQuery example); 12 | 13 | int deleteByPrimaryKey(Integer deptno); 14 | 15 | int insert(Dept record); 16 | 17 | int insertSelective(Dept record); 18 | 19 | List selectByExample(DeptQuery example); 20 | 21 | Dept selectByPrimaryKey(Integer deptno); 22 | 23 | int updateByExampleSelective(@Param("record") Dept record, @Param("example") DeptQuery example); 24 | 25 | int updateByExample(@Param("record") Dept record, @Param("example") DeptQuery example); 26 | 27 | int updateByPrimaryKeySelective(Dept record); 28 | 29 | int updateByPrimaryKey(Dept record); 30 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/E2EmpDao.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.dao.emp; 2 | 3 | import cn.ssm.core.bean.emp.E2Emp; 4 | import cn.ssm.core.bean.emp.E2EmpQuery; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface E2EmpDao { 9 | long countByExample(E2EmpQuery example); 10 | 11 | int deleteByExample(E2EmpQuery example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(E2Emp record); 16 | 17 | int insertSelective(E2Emp record); 18 | 19 | List selectByExample(E2EmpQuery example); 20 | 21 | E2Emp selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") E2Emp record, @Param("example") E2EmpQuery example); 24 | 25 | int updateByExample(@Param("record") E2Emp record, @Param("example") E2EmpQuery example); 26 | 27 | int updateByPrimaryKeySelective(E2Emp record); 28 | 29 | int updateByPrimaryKey(E2Emp record); 30 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/EmpEmpDao.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.dao.emp; 2 | 3 | import cn.ssm.core.bean.emp.EmpEmp; 4 | import cn.ssm.core.bean.emp.EmpEmpQuery; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface EmpEmpDao { 9 | long countByExample(EmpEmpQuery example); 10 | 11 | int deleteByExample(EmpEmpQuery example); 12 | 13 | int deleteByPrimaryKey(Integer empno); 14 | 15 | int insert(EmpEmp record); 16 | 17 | int insertSelective(EmpEmp record); 18 | 19 | List selectByExample(EmpEmpQuery example); 20 | 21 | EmpEmp selectByPrimaryKey(Integer empno); 22 | 23 | int updateByExampleSelective(@Param("record") EmpEmp record, @Param("example") EmpEmpQuery example); 24 | 25 | int updateByExample(@Param("record") EmpEmp record, @Param("example") EmpEmpQuery example); 26 | 27 | int updateByPrimaryKeySelective(EmpEmp record); 28 | 29 | int updateByPrimaryKey(EmpEmp record); 30 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/SalgradeempDao.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.dao.emp; 2 | 3 | import cn.ssm.core.bean.emp.Salgradeemp; 4 | import cn.ssm.core.bean.emp.SalgradeempQuery; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SalgradeempDao { 9 | long countByExample(SalgradeempQuery example); 10 | 11 | int deleteByExample(SalgradeempQuery example); 12 | 13 | int deleteByPrimaryKey(Integer grade); 14 | 15 | int insert(Salgradeemp record); 16 | 17 | int insertSelective(Salgradeemp record); 18 | 19 | List selectByExample(SalgradeempQuery example); 20 | 21 | Salgradeemp selectByPrimaryKey(Integer grade); 22 | 23 | int updateByExampleSelective(@Param("record") Salgradeemp record, @Param("example") SalgradeempQuery example); 24 | 25 | int updateByExample(@Param("record") Salgradeemp record, @Param("example") SalgradeempQuery example); 26 | 27 | int updateByPrimaryKeySelective(Salgradeemp record); 28 | 29 | int updateByPrimaryKey(Salgradeemp record); 30 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/E2Emp.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.io.Serializable; 4 | 5 | public class E2Emp implements Serializable { 6 | private Integer id; 7 | 8 | private String name; 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | public Integer getId() { 13 | return id; 14 | } 15 | 16 | public void setId(Integer id) { 17 | this.id = id; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name == null ? null : name.trim(); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | StringBuilder sb = new StringBuilder(); 31 | sb.append(getClass().getSimpleName()); 32 | sb.append(" ["); 33 | sb.append("Hash = ").append(hashCode()); 34 | sb.append(", id=").append(id); 35 | sb.append(", name=").append(name); 36 | sb.append(", serialVersionUID=").append(serialVersionUID); 37 | sb.append("]"); 38 | return sb.toString(); 39 | } 40 | } -------------------------------------------------------------------------------- /src/GeneratorSqlmap.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.io.File; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.mybatis.generator.api.MyBatisGenerator; 8 | import org.mybatis.generator.config.Configuration; 9 | import org.mybatis.generator.config.xml.ConfigurationParser; 10 | import org.mybatis.generator.internal.DefaultShellCallback; 11 | 12 | public class GeneratorSqlmap { 13 | 14 | public void generator() throws Exception{ 15 | 16 | List warnings = new ArrayList(); 17 | boolean overwrite = true; 18 | File configFile = new File("generatorConfig.xml"); 19 | ConfigurationParser cp = new ConfigurationParser(warnings); 20 | Configuration config = cp.parseConfiguration(configFile); 21 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 22 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, 23 | callback, warnings); 24 | myBatisGenerator.generate(null); 25 | 26 | } 27 | public static void main(String[] args) throws Exception { 28 | try { 29 | GeneratorSqlmap generatorSqlmap = new GeneratorSqlmap(); 30 | generatorSqlmap.generator(); 31 | } catch (Exception e) { 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/Salgradeemp.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Salgradeemp implements Serializable { 6 | private Integer grade; 7 | 8 | private Integer losal; 9 | 10 | private Integer hisal; 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | public Integer getGrade() { 15 | return grade; 16 | } 17 | 18 | public void setGrade(Integer grade) { 19 | this.grade = grade; 20 | } 21 | 22 | public Integer getLosal() { 23 | return losal; 24 | } 25 | 26 | public void setLosal(Integer losal) { 27 | this.losal = losal; 28 | } 29 | 30 | public Integer getHisal() { 31 | return hisal; 32 | } 33 | 34 | public void setHisal(Integer hisal) { 35 | this.hisal = hisal; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | StringBuilder sb = new StringBuilder(); 41 | sb.append(getClass().getSimpleName()); 42 | sb.append(" ["); 43 | sb.append("Hash = ").append(hashCode()); 44 | sb.append(", grade=").append(grade); 45 | sb.append(", losal=").append(losal); 46 | sb.append(", hisal=").append(hisal); 47 | sb.append(", serialVersionUID=").append(serialVersionUID); 48 | sb.append("]"); 49 | return sb.toString(); 50 | } 51 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/dept/Dept.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.dept; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Dept implements Serializable { 6 | private Integer deptno; 7 | 8 | private String dname; 9 | 10 | private String loc; 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | public Integer getDeptno() { 15 | return deptno; 16 | } 17 | 18 | public void setDeptno(Integer deptno) { 19 | this.deptno = deptno; 20 | } 21 | 22 | public String getDname() { 23 | return dname; 24 | } 25 | 26 | public void setDname(String dname) { 27 | this.dname = dname == null ? null : dname.trim(); 28 | } 29 | 30 | public String getLoc() { 31 | return loc; 32 | } 33 | 34 | public void setLoc(String loc) { 35 | this.loc = loc == null ? null : loc.trim(); 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | StringBuilder sb = new StringBuilder(); 41 | sb.append(getClass().getSimpleName()); 42 | sb.append(" ["); 43 | sb.append("Hash = ").append(hashCode()); 44 | sb.append(", deptno=").append(deptno); 45 | sb.append(", dname=").append(dname); 46 | sb.append(", loc=").append(loc); 47 | sb.append(", serialVersionUID=").append(serialVersionUID); 48 | sb.append("]"); 49 | return sb.toString(); 50 | } 51 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/EmpEmp.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.io.Serializable; 4 | import java.math.BigDecimal; 5 | import java.util.Date; 6 | 7 | public class EmpEmp implements Serializable { 8 | private Integer empno; 9 | 10 | private String ename; 11 | 12 | private String job; 13 | 14 | private Integer mgr; 15 | 16 | private Date hiredate; 17 | 18 | private BigDecimal sal; 19 | 20 | private BigDecimal comm; 21 | 22 | private Integer deptno; 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | public Integer getEmpno() { 27 | return empno; 28 | } 29 | 30 | public void setEmpno(Integer empno) { 31 | this.empno = empno; 32 | } 33 | 34 | public String getEname() { 35 | return ename; 36 | } 37 | 38 | public void setEname(String ename) { 39 | this.ename = ename == null ? null : ename.trim(); 40 | } 41 | 42 | public String getJob() { 43 | return job; 44 | } 45 | 46 | public void setJob(String job) { 47 | this.job = job == null ? null : job.trim(); 48 | } 49 | 50 | public Integer getMgr() { 51 | return mgr; 52 | } 53 | 54 | public void setMgr(Integer mgr) { 55 | this.mgr = mgr; 56 | } 57 | 58 | public Date getHiredate() { 59 | return hiredate; 60 | } 61 | 62 | public void setHiredate(Date hiredate) { 63 | this.hiredate = hiredate; 64 | } 65 | 66 | public BigDecimal getSal() { 67 | return sal; 68 | } 69 | 70 | public void setSal(BigDecimal sal) { 71 | this.sal = sal; 72 | } 73 | 74 | public BigDecimal getComm() { 75 | return comm; 76 | } 77 | 78 | public void setComm(BigDecimal comm) { 79 | this.comm = comm; 80 | } 81 | 82 | public Integer getDeptno() { 83 | return deptno; 84 | } 85 | 86 | public void setDeptno(Integer deptno) { 87 | this.deptno = deptno; 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | StringBuilder sb = new StringBuilder(); 93 | sb.append(getClass().getSimpleName()); 94 | sb.append(" ["); 95 | sb.append("Hash = ").append(hashCode()); 96 | sb.append(", empno=").append(empno); 97 | sb.append(", ename=").append(ename); 98 | sb.append(", job=").append(job); 99 | sb.append(", mgr=").append(mgr); 100 | sb.append(", hiredate=").append(hiredate); 101 | sb.append(", sal=").append(sal); 102 | sb.append(", comm=").append(comm); 103 | sb.append(", deptno=").append(deptno); 104 | sb.append(", serialVersionUID=").append(serialVersionUID); 105 | sb.append("]"); 106 | return sb.toString(); 107 | } 108 | } -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/rename/RenameJavaMapperPlugin.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.rename; 2 | 3 | 4 | import static org.mybatis.generator.internal.util.StringUtility.stringHasValue; 5 | import static org.mybatis.generator.internal.util.messages.Messages.getString; 6 | 7 | import java.util.List; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | import org.mybatis.generator.api.PluginAdapter; 12 | import org.mybatis.generator.api.IntrospectedTable; 13 | 14 | /** 15 | * This plugin demonstrates overriding the initialized() method to rename the 16 | * generated example classes. Instead of xxxExample, the classes will be named 17 | * xxxCriteria 18 | * 19 | * This plugin accepts two properties: 20 | *
    21 | *
  • searchString (required) the regular expression of the name 22 | * search.
  • 23 | *
  • replaceString (required) the replacement String.
  • 24 | *
25 | * 26 | * For example, to change the name of the generated Example classes from 27 | * xxxExample to xxxCriteria, specify the following: 28 | * 29 | *
30 | *
searchString
31 | *
Example$
32 | *
replaceString
33 | *
Criteria
34 | *
35 | * 36 | * 37 | * @author Jeff Butler 38 | * 39 | */ 40 | public class RenameJavaMapperPlugin extends PluginAdapter { 41 | private String searchString; 42 | private String replaceString; 43 | private Pattern pattern; 44 | 45 | 46 | public RenameJavaMapperPlugin() { 47 | } 48 | 49 | public boolean validate(List warnings) { 50 | 51 | searchString = properties.getProperty("searchString"); //$NON-NLS-1$ 52 | replaceString = properties.getProperty("replaceString"); //$NON-NLS-1$ 53 | 54 | boolean valid = stringHasValue(searchString) 55 | && stringHasValue(replaceString); 56 | 57 | if (valid) { 58 | pattern = Pattern.compile(searchString); 59 | } else { 60 | if (!stringHasValue(searchString)) { 61 | warnings.add(getString("ValidationError.18", //$NON-NLS-1$ 62 | "RenameExampleClassPlugin", //$NON-NLS-1$ 63 | "searchString")); //$NON-NLS-1$ 64 | } 65 | if (!stringHasValue(replaceString)) { 66 | warnings.add(getString("ValidationError.18", //$NON-NLS-1$ 67 | "RenameExampleClassPlugin", //$NON-NLS-1$ 68 | "replaceString")); //$NON-NLS-1$ 69 | } 70 | } 71 | 72 | return valid; 73 | } 74 | 75 | @Override 76 | public void initialized(IntrospectedTable introspectedTable) { 77 | String oldType = introspectedTable.getMyBatis3JavaMapperType(); 78 | Matcher matcher = pattern.matcher(oldType); 79 | oldType = matcher.replaceAll(replaceString); 80 | 81 | introspectedTable.setMyBatis3JavaMapperType(oldType); 82 | 83 | } 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/rename/RenameSqlMapperPlugin.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.rename; 2 | 3 | 4 | import static org.mybatis.generator.internal.util.StringUtility.stringHasValue; 5 | import static org.mybatis.generator.internal.util.messages.Messages.getString; 6 | 7 | import java.util.List; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | import org.mybatis.generator.api.PluginAdapter; 12 | import org.mybatis.generator.api.IntrospectedTable; 13 | 14 | /** 15 | * This plugin demonstrates overriding the initialized() method to rename the 16 | * generated example classes. Instead of xxxExample, the classes will be named 17 | * xxxCriteria 18 | * 19 | * This plugin accepts two properties: 20 | *
    21 | *
  • searchString (required) the regular expression of the name 22 | * search.
  • 23 | *
  • replaceString (required) the replacement String.
  • 24 | *
25 | * 26 | * For example, to change the name of the generated Example classes from 27 | * xxxExample to xxxCriteria, specify the following: 28 | * 29 | *
30 | *
searchString
31 | *
Example$
32 | *
replaceString
33 | *
Criteria
34 | *
35 | * 36 | * 37 | * @author Jeff Butler 38 | * 39 | */ 40 | public class RenameSqlMapperPlugin extends PluginAdapter { 41 | private String searchString; 42 | private String replaceString; 43 | private Pattern pattern; 44 | 45 | 46 | public RenameSqlMapperPlugin() { 47 | } 48 | 49 | public boolean validate(List warnings) { 50 | 51 | searchString = properties.getProperty("searchString"); //$NON-NLS-1$ 52 | replaceString = properties.getProperty("replaceString"); //$NON-NLS-1$ 53 | 54 | boolean valid = stringHasValue(searchString) 55 | && stringHasValue(replaceString); 56 | 57 | if (valid) { 58 | pattern = Pattern.compile(searchString); 59 | } else { 60 | if (!stringHasValue(searchString)) { 61 | warnings.add(getString("ValidationError.18", //$NON-NLS-1$ 62 | "RenameExampleClassPlugin", //$NON-NLS-1$ 63 | "searchString")); //$NON-NLS-1$ 64 | } 65 | if (!stringHasValue(replaceString)) { 66 | warnings.add(getString("ValidationError.18", //$NON-NLS-1$ 67 | "RenameExampleClassPlugin", //$NON-NLS-1$ 68 | "replaceString")); //$NON-NLS-1$ 69 | } 70 | } 71 | 72 | return valid; 73 | } 74 | 75 | @Override 76 | public void initialized(IntrospectedTable introspectedTable) { 77 | String oldType = introspectedTable.getMyBatis3XmlMapperFileName(); 78 | Matcher matcher = pattern.matcher(oldType); 79 | oldType = matcher.replaceAll(replaceString); 80 | 81 | introspectedTable.setMyBatis3XmlMapperFileName(oldType); 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/table/TkMyBatis3Impl.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.table; 2 | 3 | 4 | import org.mybatis.generator.codegen.mybatis3.IntrospectedTableMyBatis3Impl; 5 | import org.mybatis.generator.config.JavaModelGeneratorConfiguration; 6 | 7 | import java.text.MessageFormat; 8 | import java.util.List; 9 | 10 | import static org.mybatis.generator.internal.util.StringUtility.stringHasValue; 11 | 12 | /** 13 | * Created by mypc on 2017/2/13. 14 | */ 15 | public class TkMyBatis3Impl extends IntrospectedTableMyBatis3Impl { 16 | @Override 17 | protected String calculateMyBatis3XmlMapperFileName() { 18 | StringBuilder sb = new StringBuilder(); 19 | if (stringHasValue(tableConfiguration.getMapperName())) { 20 | String mapperName = tableConfiguration.getMapperName(); 21 | int ind = mapperName.lastIndexOf('.'); 22 | if (ind != -1) { 23 | mapperName = mapperName.substring(ind + 1); 24 | } 25 | //支持mapperName = "{0}Dao" 等用法 26 | sb.append(MessageFormat.format(mapperName, fullyQualifiedTable.getDomainObjectName())); 27 | sb.append("Mapper.xml"); //$NON-NLS-1$ 28 | } else { 29 | sb.append(fullyQualifiedTable.getDomainObjectName()); 30 | sb.append("Mapper.xml"); //$NON-NLS-1$ 31 | } 32 | return sb.toString(); 33 | } 34 | 35 | @Override 36 | protected void calculateJavaClientAttributes() { 37 | if (context.getJavaClientGeneratorConfiguration() == null) { 38 | return; 39 | } 40 | 41 | StringBuilder sb = new StringBuilder(); 42 | sb.append(calculateJavaClientImplementationPackage()); 43 | sb.append('.'); 44 | sb.append(fullyQualifiedTable.getDomainObjectName()); 45 | sb.append("DAOImpl"); //$NON-NLS-1$ 46 | setDAOImplementationType(sb.toString()); 47 | 48 | sb.setLength(0); 49 | sb.append(calculateJavaClientInterfacePackage()); 50 | sb.append('.'); 51 | sb.append(fullyQualifiedTable.getDomainObjectName()); 52 | sb.append("DAO"); //$NON-NLS-1$ 53 | setDAOInterfaceType(sb.toString()); 54 | 55 | sb.setLength(0); 56 | sb.append(calculateJavaClientInterfacePackage()); 57 | sb.append('.'); 58 | if (stringHasValue(tableConfiguration.getMapperName())) { 59 | //支持mapperName = "{0}Dao" 等用法 60 | sb.append(MessageFormat.format(tableConfiguration.getMapperName(), fullyQualifiedTable.getDomainObjectName())); 61 | sb.append("Mapper"); 62 | } else { 63 | sb.append(fullyQualifiedTable.getDomainObjectName()); 64 | sb.append("Mapper"); //$NON-NLS-1$ 65 | } 66 | setMyBatis3JavaMapperType(sb.toString()); 67 | 68 | sb.setLength(0); 69 | sb.append(calculateJavaClientInterfacePackage()); 70 | sb.append('.'); 71 | if (stringHasValue(tableConfiguration.getSqlProviderName())) { 72 | //支持mapperName = "{0}SqlProvider" 等用法 73 | sb.append(MessageFormat.format(tableConfiguration.getSqlProviderName(), fullyQualifiedTable.getDomainObjectName())); 74 | sb.append("Mapper"); 75 | } else { 76 | sb.append(fullyQualifiedTable.getDomainObjectName()); 77 | sb.append("SqlProvider"); //$NON-NLS-1$ 78 | } 79 | setMyBatis3SqlProviderType(sb.toString()); 80 | } 81 | 82 | 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/comment/MyCommentGenerator.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.comment; 2 | 3 | import java.util.Properties; 4 | 5 | import org.mybatis.generator.api.CommentGenerator; 6 | import org.mybatis.generator.api.IntrospectedColumn; 7 | import org.mybatis.generator.api.IntrospectedTable; 8 | import org.mybatis.generator.api.dom.java.*; 9 | import org.mybatis.generator.api.dom.xml.XmlElement; 10 | 11 | public class MyCommentGenerator implements CommentGenerator { 12 | 13 | @Override 14 | public void addConfigurationProperties(Properties properties) { 15 | // TODO Auto-generated method stub 16 | 17 | } 18 | 19 | @Override 20 | public void addFieldComment(Field field, 21 | IntrospectedTable introspectedTable, 22 | IntrospectedColumn introspectedColumn) { 23 | // TODO Auto-generated method stub 24 | if (introspectedColumn.getRemarks() != null && !introspectedColumn.getRemarks().equals("")) { 25 | field.addJavaDocLine("/**"); 26 | field.addJavaDocLine(" * " + introspectedColumn.getRemarks()); 27 | // addJavadocTag(field, false); 28 | field.addJavaDocLine(" */"); 29 | } 30 | } 31 | 32 | @Override 33 | public void addFieldComment(Field field, IntrospectedTable introspectedTable) { 34 | // TODO Auto-generated method stub 35 | 36 | 37 | } 38 | 39 | @Override 40 | public void addModelClassComment(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) { 41 | 42 | } 43 | 44 | @Override 45 | public void addClassComment(InnerClass innerClass, 46 | IntrospectedTable introspectedTable) { 47 | // TODO Auto-generated method stub 48 | 49 | } 50 | 51 | @Override 52 | public void addClassComment(InnerClass innerClass, 53 | IntrospectedTable introspectedTable, boolean markAsDoNotDelete) { 54 | // TODO Auto-generated method stub 55 | 56 | } 57 | 58 | @Override 59 | public void addEnumComment(InnerEnum innerEnum, 60 | IntrospectedTable introspectedTable) { 61 | // TODO Auto-generated method stub 62 | 63 | } 64 | 65 | @Override 66 | public void addGetterComment(Method method, 67 | IntrospectedTable introspectedTable, 68 | IntrospectedColumn introspectedColumn) { 69 | // TODO Auto-generated method stub 70 | 71 | } 72 | 73 | @Override 74 | public void addSetterComment(Method method, 75 | IntrospectedTable introspectedTable, 76 | IntrospectedColumn introspectedColumn) { 77 | // TODO Auto-generated method stub 78 | 79 | } 80 | 81 | @Override 82 | public void addGeneralMethodComment(Method method, 83 | IntrospectedTable introspectedTable) { 84 | // TODO Auto-generated method stub 85 | 86 | } 87 | 88 | @Override 89 | public void addJavaFileComment(CompilationUnit compilationUnit) { 90 | // TODO Auto-generated method stub 91 | 92 | } 93 | 94 | @Override 95 | public void addComment(XmlElement xmlElement) { 96 | // TODO Auto-generated method stub 97 | 98 | } 99 | 100 | @Override 101 | public void addRootComment(XmlElement rootElement) { 102 | // TODO Auto-generated method stub 103 | 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/field/FieldsPlugin.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.field; 2 | import java.util.List; 3 | 4 | import org.mybatis.generator.api.CommentGenerator; 5 | import org.mybatis.generator.api.IntrospectedColumn; 6 | import org.mybatis.generator.api.IntrospectedTable; 7 | import org.mybatis.generator.api.PluginAdapter; 8 | import org.mybatis.generator.api.dom.java.Field; 9 | import org.mybatis.generator.api.dom.java.JavaVisibility; 10 | import org.mybatis.generator.api.dom.java.Method; 11 | import org.mybatis.generator.api.dom.java.Parameter; 12 | import org.mybatis.generator.api.dom.java.PrimitiveTypeWrapper; 13 | import org.mybatis.generator.api.dom.java.TopLevelClass; 14 | import org.mybatis.generator.api.dom.xml.Attribute; 15 | import org.mybatis.generator.api.dom.xml.Element; 16 | import org.mybatis.generator.api.dom.xml.TextElement; 17 | import org.mybatis.generator.api.dom.xml.XmlElement; 18 | 19 | /** 20 | *

File name : PaginationPlugin.java

21 | *

Author : fly

22 | *

Date : 2013-7-2 上午11:50:45

23 | */ 24 | public class FieldsPlugin extends PluginAdapter { 25 | @Override 26 | public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, 27 | IntrospectedTable introspectedTable) { 28 | // add field, getter, setter for limit clause 29 | addfields(topLevelClass, introspectedTable, "fields"); 30 | return super.modelExampleClassGenerated(topLevelClass, 31 | introspectedTable); 32 | } 33 | 34 | @Override 35 | public boolean sqlMapBaseColumnListElementGenerated(XmlElement element, 36 | IntrospectedTable introspectedTable) { 37 | 38 | 39 | // TODO Auto-generated method stub 40 | XmlElement isNullElement = new XmlElement("if"); //$NON-NLS-1$ 41 | isNullElement.addAttribute(new Attribute("test", "fields == null")); //$NON-NLS-1$ //$NON-NLS-2$ 42 | //isNotNullElement.addAttribute(new Attribute("compareValue", "0")); //$NON-NLS-1$ //$NON-NLS-2$ 43 | for(Element e : element.getElements()){ 44 | isNullElement.addElement(e); 45 | } 46 | element.getElements().clear(); 47 | element.addElement(isNullElement); 48 | 49 | XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$ 50 | isNotNullElement.addAttribute(new Attribute("test", "fields != null")); //$NON-NLS-1$ //$NON-NLS-2$ 51 | //isNotNullElement.addAttribute(new Attribute("compareValue", "0")); //$NON-NLS-1$ //$NON-NLS-2$ 52 | isNotNullElement.addElement(new TextElement( 53 | "${fields}")); 54 | //isParameterPresenteElemen.addElement(isNotNullElement); 55 | element.addElement(isNotNullElement); 56 | 57 | return super.sqlMapBaseColumnListElementGenerated(element, introspectedTable); 58 | } 59 | 60 | private void addfields(TopLevelClass topLevelClass, 61 | IntrospectedTable introspectedTable, String name) { 62 | CommentGenerator commentGenerator = context.getCommentGenerator(); 63 | Field field = new Field(); 64 | field.setVisibility(JavaVisibility.PROTECTED); 65 | // field.setType(FullyQualifiedJavaType.getIntInstance()); 66 | field.setType(PrimitiveTypeWrapper.getStringInstance()); 67 | field.setName(name); 68 | // field.setInitializationString("1"); 69 | commentGenerator.addFieldComment(field, introspectedTable); 70 | topLevelClass.addField(field); 71 | char c = name.charAt(0); 72 | String camel = Character.toUpperCase(c) + name.substring(1); 73 | Method method = new Method(); 74 | method.setVisibility(JavaVisibility.PUBLIC); 75 | method.setName("set" + camel); 76 | method.addParameter(new Parameter(PrimitiveTypeWrapper.getStringInstance(), name)); 77 | method.addBodyLine("this." + name + "=" + name + ";"); 78 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 79 | topLevelClass.addMethod(method); 80 | method = new Method(); 81 | method.setVisibility(JavaVisibility.PUBLIC); 82 | method.setReturnType(PrimitiveTypeWrapper.getStringInstance()); 83 | method.setName("get" + camel); 84 | method.addBodyLine("return " + name + ";"); 85 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 86 | topLevelClass.addMethod(method); 87 | } 88 | 89 | 90 | 91 | @Override 92 | public boolean sqlMapSelectByPrimaryKeyElementGenerated(XmlElement element, 93 | IntrospectedTable introspectedTable) { 94 | 95 | List elements = element.getElements(); 96 | 97 | StringBuilder columns = new StringBuilder(); 98 | 99 | List allColumns = introspectedTable.getAllColumns(); 100 | 101 | 102 | for (IntrospectedColumn introspectedColumn : allColumns) { 103 | 104 | columns.append(",").append(introspectedColumn.getActualColumnName()); 105 | } 106 | columns.deleteCharAt(0); 107 | elements.set(1, new TextElement(columns.toString())); 108 | 109 | 110 | return super.sqlMapSelectByPrimaryKeyElementGenerated(element, 111 | introspectedTable); 112 | } 113 | 114 | /** 115 | * This plugin is always valid - no properties are required 116 | */ 117 | public boolean validate(List warnings) { 118 | return true; 119 | } 120 | 121 | } -------------------------------------------------------------------------------- /generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 50 | 51 | 52 | 53 | 56 | 57 | 62 | 63 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 82 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 130 | 131 | 135 | 136 | 137 | 138 | 139 |
140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /src/org/mybatis/generator/plugins/page/PaginationPlugin.java: -------------------------------------------------------------------------------- 1 | package org.mybatis.generator.plugins.page; 2 | 3 | import java.util.List; 4 | 5 | import org.mybatis.generator.api.CommentGenerator; 6 | import org.mybatis.generator.api.IntrospectedTable; 7 | import org.mybatis.generator.api.PluginAdapter; 8 | import org.mybatis.generator.api.dom.java.Field; 9 | import org.mybatis.generator.api.dom.java.JavaVisibility; 10 | import org.mybatis.generator.api.dom.java.Method; 11 | import org.mybatis.generator.api.dom.java.Parameter; 12 | import org.mybatis.generator.api.dom.java.PrimitiveTypeWrapper; 13 | import org.mybatis.generator.api.dom.java.TopLevelClass; 14 | import org.mybatis.generator.api.dom.xml.Attribute; 15 | import org.mybatis.generator.api.dom.xml.TextElement; 16 | import org.mybatis.generator.api.dom.xml.XmlElement; 17 | 18 | /** 19 | *

File name : PaginationPlugin.java

20 | *

Author : fly

21 | *

Date : 2013-7-2 上午11:50:45

22 | */ 23 | public class PaginationPlugin extends PluginAdapter { 24 | @Override 25 | public boolean modelExampleClassGenerated(TopLevelClass topLevelClass, 26 | IntrospectedTable introspectedTable) { 27 | // add field, getter, setter for limit clause 28 | addPageNo(topLevelClass, introspectedTable, "pageNo"); 29 | addStartRow(topLevelClass, introspectedTable, "startRow"); 30 | addPageSize(topLevelClass, introspectedTable, "pageSize"); 31 | return super.modelExampleClassGenerated(topLevelClass, 32 | introspectedTable); 33 | } 34 | 35 | @Override 36 | public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated( 37 | XmlElement element, IntrospectedTable introspectedTable) { 38 | // XmlElement isParameterPresenteElemen = (XmlElement) element 39 | // .getElements().get(element.getElements().size() - 1); 40 | XmlElement isNotNullElement = new XmlElement("if"); //$NON-NLS-1$ 41 | isNotNullElement.addAttribute(new Attribute("test", "startRow != null")); //$NON-NLS-1$ //$NON-NLS-2$ 42 | // isNotNullElement.addAttribute(new Attribute("compareValue", "0")); //$NON-NLS-1$ //$NON-NLS-2$ 43 | isNotNullElement.addElement(new TextElement( 44 | "limit #{startRow} , #{pageSize}")); 45 | // isParameterPresenteElemen.addElement(isNotNullElement); 46 | element.addElement(isNotNullElement); 47 | return super.sqlMapUpdateByExampleWithoutBLOBsElementGenerated(element, 48 | introspectedTable); 49 | } 50 | 51 | private void addStartRow(TopLevelClass topLevelClass, 52 | IntrospectedTable introspectedTable, String name) { 53 | CommentGenerator commentGenerator = context.getCommentGenerator(); 54 | Field field = new Field(); 55 | field.setVisibility(JavaVisibility.PROTECTED); 56 | // field.setType(FullyQualifiedJavaType.getIntInstance()); 57 | field.setType(PrimitiveTypeWrapper.getIntegerInstance()); 58 | field.setName(name); 59 | // field.setInitializationString("-1"); 60 | commentGenerator.addFieldComment(field, introspectedTable); 61 | topLevelClass.addField(field); 62 | char c = name.charAt(0); 63 | String camel = Character.toUpperCase(c) + name.substring(1); 64 | Method method = new Method(); 65 | method.setVisibility(JavaVisibility.PUBLIC); 66 | method.setName("set" + camel); 67 | method.addParameter(new Parameter(PrimitiveTypeWrapper.getIntegerInstance(), name)); 68 | method.addBodyLine("this." + name + "=" + name + ";"); 69 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 70 | topLevelClass.addMethod(method); 71 | method = new Method(); 72 | method.setVisibility(JavaVisibility.PUBLIC); 73 | method.setReturnType(PrimitiveTypeWrapper.getIntegerInstance()); 74 | method.setName("get" + camel); 75 | method.addBodyLine("return " + name + ";"); 76 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 77 | topLevelClass.addMethod(method); 78 | } 79 | 80 | private void addPageSize(TopLevelClass topLevelClass, 81 | IntrospectedTable introspectedTable, String name) { 82 | CommentGenerator commentGenerator = context.getCommentGenerator(); 83 | Field field = new Field(); 84 | field.setVisibility(JavaVisibility.PROTECTED); 85 | // field.setType(FullyQualifiedJavaType.getIntInstance()); 86 | field.setType(PrimitiveTypeWrapper.getIntegerInstance()); 87 | field.setName(name); 88 | field.setInitializationString("10"); 89 | commentGenerator.addFieldComment(field, introspectedTable); 90 | topLevelClass.addField(field); 91 | char c = name.charAt(0); 92 | String camel = Character.toUpperCase(c) + name.substring(1); 93 | Method method = new Method(); 94 | method.setVisibility(JavaVisibility.PUBLIC); 95 | method.setName("set" + camel); 96 | method.addParameter(new Parameter(PrimitiveTypeWrapper.getIntegerInstance(), name)); 97 | method.addBodyLine("this." + name + "=" + name + ";"); 98 | //this.startRow = (pageNo-1)*this.pageSize; 99 | method.addBodyLine("this.startRow = (pageNo-1)*this." + name + ";"); 100 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 101 | topLevelClass.addMethod(method); 102 | method = new Method(); 103 | method.setVisibility(JavaVisibility.PUBLIC); 104 | method.setReturnType(PrimitiveTypeWrapper.getIntegerInstance()); 105 | method.setName("get" + camel); 106 | method.addBodyLine("return " + name + ";"); 107 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 108 | topLevelClass.addMethod(method); 109 | } 110 | 111 | private void addPageNo(TopLevelClass topLevelClass, 112 | IntrospectedTable introspectedTable, String name) { 113 | CommentGenerator commentGenerator = context.getCommentGenerator(); 114 | Field field = new Field(); 115 | field.setVisibility(JavaVisibility.PROTECTED); 116 | // field.setType(FullyQualifiedJavaType.getIntInstance()); 117 | field.setType(PrimitiveTypeWrapper.getIntegerInstance()); 118 | field.setName(name); 119 | field.setInitializationString("1"); 120 | commentGenerator.addFieldComment(field, introspectedTable); 121 | topLevelClass.addField(field); 122 | char c = name.charAt(0); 123 | String camel = Character.toUpperCase(c) + name.substring(1); 124 | Method method = new Method(); 125 | method.setVisibility(JavaVisibility.PUBLIC); 126 | method.setName("set" + camel); 127 | method.addParameter(new Parameter(PrimitiveTypeWrapper.getIntegerInstance(), name)); 128 | method.addBodyLine("this." + name + "=" + name + ";"); 129 | method.addBodyLine("this.startRow = (" + name + "-1)*this.pageSize;"); 130 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 131 | topLevelClass.addMethod(method); 132 | method = new Method(); 133 | method.setVisibility(JavaVisibility.PUBLIC); 134 | method.setReturnType(PrimitiveTypeWrapper.getIntegerInstance()); 135 | method.setName("get" + camel); 136 | method.addBodyLine("return " + name + ";"); 137 | commentGenerator.addGeneralMethodComment(method, introspectedTable); 138 | topLevelClass.addMethod(method); 139 | } 140 | 141 | /** 142 | * This plugin is always valid - no properties are required 143 | */ 144 | public boolean validate(List warnings) { 145 | return true; 146 | } 147 | 148 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/dept/DeptDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | and ${criterion.condition} 18 | 19 | 20 | and ${criterion.condition} #{criterion.value} 21 | 22 | 23 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 24 | 25 | 26 | and ${criterion.condition} 27 | 28 | #{listItem} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | and ${criterion.condition} 47 | 48 | 49 | and ${criterion.condition} #{criterion.value} 50 | 51 | 52 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 53 | 54 | 55 | and ${criterion.condition} 56 | 57 | #{listItem} 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | deptno, dname, loc 70 | 71 | 72 | ${fields} 73 | 74 | 75 | 92 | 98 | 99 | delete from dept 100 | where deptno = #{deptno,jdbcType=INTEGER} 101 | 102 | 103 | delete from dept 104 | 105 | 106 | 107 | 108 | 109 | insert into dept (deptno, dname, loc 110 | ) 111 | values (#{deptno,jdbcType=INTEGER}, #{dname,jdbcType=VARCHAR}, #{loc,jdbcType=VARCHAR} 112 | ) 113 | 114 | 115 | insert into dept 116 | 117 | 118 | deptno, 119 | 120 | 121 | dname, 122 | 123 | 124 | loc, 125 | 126 | 127 | 128 | 129 | #{deptno,jdbcType=INTEGER}, 130 | 131 | 132 | #{dname,jdbcType=VARCHAR}, 133 | 134 | 135 | #{loc,jdbcType=VARCHAR}, 136 | 137 | 138 | 139 | 145 | 146 | update dept 147 | 148 | 149 | deptno = #{record.deptno,jdbcType=INTEGER}, 150 | 151 | 152 | dname = #{record.dname,jdbcType=VARCHAR}, 153 | 154 | 155 | loc = #{record.loc,jdbcType=VARCHAR}, 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | update dept 164 | set deptno = #{record.deptno,jdbcType=INTEGER}, 165 | dname = #{record.dname,jdbcType=VARCHAR}, 166 | loc = #{record.loc,jdbcType=VARCHAR} 167 | 168 | 169 | 170 | 171 | 172 | update dept 173 | 174 | 175 | dname = #{dname,jdbcType=VARCHAR}, 176 | 177 | 178 | loc = #{loc,jdbcType=VARCHAR}, 179 | 180 | 181 | where deptno = #{deptno,jdbcType=INTEGER} 182 | 183 | 184 | update dept 185 | set dname = #{dname,jdbcType=VARCHAR}, 186 | loc = #{loc,jdbcType=VARCHAR} 187 | where deptno = #{deptno,jdbcType=INTEGER} 188 | 189 | -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/E2EmpQuery.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class E2EmpQuery { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | protected Integer pageNo = 1; 14 | 15 | protected Integer startRow; 16 | 17 | protected Integer pageSize = 10; 18 | 19 | protected String fields; 20 | 21 | public E2EmpQuery() { 22 | oredCriteria = new ArrayList(); 23 | } 24 | 25 | public void setOrderByClause(String orderByClause) { 26 | this.orderByClause = orderByClause; 27 | } 28 | 29 | public String getOrderByClause() { 30 | return orderByClause; 31 | } 32 | 33 | public void setDistinct(boolean distinct) { 34 | this.distinct = distinct; 35 | } 36 | 37 | public boolean isDistinct() { 38 | return distinct; 39 | } 40 | 41 | public List getOredCriteria() { 42 | return oredCriteria; 43 | } 44 | 45 | public void or(Criteria criteria) { 46 | oredCriteria.add(criteria); 47 | } 48 | 49 | public Criteria or() { 50 | Criteria criteria = createCriteriaInternal(); 51 | oredCriteria.add(criteria); 52 | return criteria; 53 | } 54 | 55 | public Criteria createCriteria() { 56 | Criteria criteria = createCriteriaInternal(); 57 | if (oredCriteria.size() == 0) { 58 | oredCriteria.add(criteria); 59 | } 60 | return criteria; 61 | } 62 | 63 | protected Criteria createCriteriaInternal() { 64 | Criteria criteria = new Criteria(); 65 | return criteria; 66 | } 67 | 68 | public void clear() { 69 | oredCriteria.clear(); 70 | orderByClause = null; 71 | distinct = false; 72 | } 73 | 74 | public void setPageNo(Integer pageNo) { 75 | this.pageNo=pageNo; 76 | this.startRow = (pageNo-1)*this.pageSize; 77 | } 78 | 79 | public Integer getPageNo() { 80 | return pageNo; 81 | } 82 | 83 | public void setStartRow(Integer startRow) { 84 | this.startRow=startRow; 85 | } 86 | 87 | public Integer getStartRow() { 88 | return startRow; 89 | } 90 | 91 | public void setPageSize(Integer pageSize) { 92 | this.pageSize=pageSize; 93 | this.startRow = (pageNo-1)*this.pageSize; 94 | } 95 | 96 | public Integer getPageSize() { 97 | return pageSize; 98 | } 99 | 100 | public void setFields(String fields) { 101 | this.fields=fields; 102 | } 103 | 104 | public String getFields() { 105 | return fields; 106 | } 107 | 108 | protected abstract static class GeneratedCriteria { 109 | protected List criteria; 110 | 111 | protected GeneratedCriteria() { 112 | super(); 113 | criteria = new ArrayList(); 114 | } 115 | 116 | public boolean isValid() { 117 | return criteria.size() > 0; 118 | } 119 | 120 | public List getAllCriteria() { 121 | return criteria; 122 | } 123 | 124 | public List getCriteria() { 125 | return criteria; 126 | } 127 | 128 | protected void addCriterion(String condition) { 129 | if (condition == null) { 130 | throw new RuntimeException("Value for condition cannot be null"); 131 | } 132 | criteria.add(new Criterion(condition)); 133 | } 134 | 135 | protected void addCriterion(String condition, Object value, String property) { 136 | if (value == null) { 137 | throw new RuntimeException("Value for " + property + " cannot be null"); 138 | } 139 | criteria.add(new Criterion(condition, value)); 140 | } 141 | 142 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 143 | if (value1 == null || value2 == null) { 144 | throw new RuntimeException("Between values for " + property + " cannot be null"); 145 | } 146 | criteria.add(new Criterion(condition, value1, value2)); 147 | } 148 | 149 | public Criteria andIdIsNull() { 150 | addCriterion("id is null"); 151 | return (Criteria) this; 152 | } 153 | 154 | public Criteria andIdIsNotNull() { 155 | addCriterion("id is not null"); 156 | return (Criteria) this; 157 | } 158 | 159 | public Criteria andIdEqualTo(Integer value) { 160 | addCriterion("id =", value, "id"); 161 | return (Criteria) this; 162 | } 163 | 164 | public Criteria andIdNotEqualTo(Integer value) { 165 | addCriterion("id <>", value, "id"); 166 | return (Criteria) this; 167 | } 168 | 169 | public Criteria andIdGreaterThan(Integer value) { 170 | addCriterion("id >", value, "id"); 171 | return (Criteria) this; 172 | } 173 | 174 | public Criteria andIdGreaterThanOrEqualTo(Integer value) { 175 | addCriterion("id >=", value, "id"); 176 | return (Criteria) this; 177 | } 178 | 179 | public Criteria andIdLessThan(Integer value) { 180 | addCriterion("id <", value, "id"); 181 | return (Criteria) this; 182 | } 183 | 184 | public Criteria andIdLessThanOrEqualTo(Integer value) { 185 | addCriterion("id <=", value, "id"); 186 | return (Criteria) this; 187 | } 188 | 189 | public Criteria andIdIn(List values) { 190 | addCriterion("id in", values, "id"); 191 | return (Criteria) this; 192 | } 193 | 194 | public Criteria andIdNotIn(List values) { 195 | addCriterion("id not in", values, "id"); 196 | return (Criteria) this; 197 | } 198 | 199 | public Criteria andIdBetween(Integer value1, Integer value2) { 200 | addCriterion("id between", value1, value2, "id"); 201 | return (Criteria) this; 202 | } 203 | 204 | public Criteria andIdNotBetween(Integer value1, Integer value2) { 205 | addCriterion("id not between", value1, value2, "id"); 206 | return (Criteria) this; 207 | } 208 | 209 | public Criteria andNameIsNull() { 210 | addCriterion("name is null"); 211 | return (Criteria) this; 212 | } 213 | 214 | public Criteria andNameIsNotNull() { 215 | addCriterion("name is not null"); 216 | return (Criteria) this; 217 | } 218 | 219 | public Criteria andNameEqualTo(String value) { 220 | addCriterion("name =", value, "name"); 221 | return (Criteria) this; 222 | } 223 | 224 | public Criteria andNameNotEqualTo(String value) { 225 | addCriterion("name <>", value, "name"); 226 | return (Criteria) this; 227 | } 228 | 229 | public Criteria andNameGreaterThan(String value) { 230 | addCriterion("name >", value, "name"); 231 | return (Criteria) this; 232 | } 233 | 234 | public Criteria andNameGreaterThanOrEqualTo(String value) { 235 | addCriterion("name >=", value, "name"); 236 | return (Criteria) this; 237 | } 238 | 239 | public Criteria andNameLessThan(String value) { 240 | addCriterion("name <", value, "name"); 241 | return (Criteria) this; 242 | } 243 | 244 | public Criteria andNameLessThanOrEqualTo(String value) { 245 | addCriterion("name <=", value, "name"); 246 | return (Criteria) this; 247 | } 248 | 249 | public Criteria andNameLike(String value) { 250 | addCriterion("name like", value, "name"); 251 | return (Criteria) this; 252 | } 253 | 254 | public Criteria andNameNotLike(String value) { 255 | addCriterion("name not like", value, "name"); 256 | return (Criteria) this; 257 | } 258 | 259 | public Criteria andNameIn(List values) { 260 | addCriterion("name in", values, "name"); 261 | return (Criteria) this; 262 | } 263 | 264 | public Criteria andNameNotIn(List values) { 265 | addCriterion("name not in", values, "name"); 266 | return (Criteria) this; 267 | } 268 | 269 | public Criteria andNameBetween(String value1, String value2) { 270 | addCriterion("name between", value1, value2, "name"); 271 | return (Criteria) this; 272 | } 273 | 274 | public Criteria andNameNotBetween(String value1, String value2) { 275 | addCriterion("name not between", value1, value2, "name"); 276 | return (Criteria) this; 277 | } 278 | } 279 | 280 | public static class Criteria extends GeneratedCriteria { 281 | 282 | protected Criteria() { 283 | super(); 284 | } 285 | } 286 | 287 | public static class Criterion { 288 | private String condition; 289 | 290 | private Object value; 291 | 292 | private Object secondValue; 293 | 294 | private boolean noValue; 295 | 296 | private boolean singleValue; 297 | 298 | private boolean betweenValue; 299 | 300 | private boolean listValue; 301 | 302 | private String typeHandler; 303 | 304 | public String getCondition() { 305 | return condition; 306 | } 307 | 308 | public Object getValue() { 309 | return value; 310 | } 311 | 312 | public Object getSecondValue() { 313 | return secondValue; 314 | } 315 | 316 | public boolean isNoValue() { 317 | return noValue; 318 | } 319 | 320 | public boolean isSingleValue() { 321 | return singleValue; 322 | } 323 | 324 | public boolean isBetweenValue() { 325 | return betweenValue; 326 | } 327 | 328 | public boolean isListValue() { 329 | return listValue; 330 | } 331 | 332 | public String getTypeHandler() { 333 | return typeHandler; 334 | } 335 | 336 | protected Criterion(String condition) { 337 | super(); 338 | this.condition = condition; 339 | this.typeHandler = null; 340 | this.noValue = true; 341 | } 342 | 343 | protected Criterion(String condition, Object value, String typeHandler) { 344 | super(); 345 | this.condition = condition; 346 | this.value = value; 347 | this.typeHandler = typeHandler; 348 | if (value instanceof List) { 349 | this.listValue = true; 350 | } else { 351 | this.singleValue = true; 352 | } 353 | } 354 | 355 | protected Criterion(String condition, Object value) { 356 | this(condition, value, null); 357 | } 358 | 359 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 360 | super(); 361 | this.condition = condition; 362 | this.value = value; 363 | this.secondValue = secondValue; 364 | this.typeHandler = typeHandler; 365 | this.betweenValue = true; 366 | } 367 | 368 | protected Criterion(String condition, Object value, Object secondValue) { 369 | this(condition, value, secondValue, null); 370 | } 371 | } 372 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/E2EmpDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | and ${criterion.condition} 17 | 18 | 19 | and ${criterion.condition} #{criterion.value} 20 | 21 | 22 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 23 | 24 | 25 | and ${criterion.condition} 26 | 27 | #{listItem} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | and ${criterion.condition} 46 | 47 | 48 | and ${criterion.condition} #{criterion.value} 49 | 50 | 51 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 52 | 53 | 54 | and ${criterion.condition} 55 | 56 | #{listItem} 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | id, name 69 | 70 | 71 | ${fields} 72 | 73 | 74 | 91 | 97 | 98 | delete from e2_emp 99 | where id = #{id,jdbcType=INTEGER} 100 | 101 | 102 | delete from e2_emp 103 | 104 | 105 | 106 | 107 | 108 | insert into e2_emp (id, name) 109 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}) 110 | 111 | 112 | insert into e2_emp 113 | 114 | 115 | id, 116 | 117 | 118 | name, 119 | 120 | 121 | 122 | 123 | #{id,jdbcType=INTEGER}, 124 | 125 | 126 | #{name,jdbcType=VARCHAR}, 127 | 128 | 129 | 130 | 136 | 137 | update e2_emp 138 | 139 | 140 | id = #{record.id,jdbcType=INTEGER}, 141 | 142 | 143 | name = #{record.name,jdbcType=VARCHAR}, 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | update e2_emp 152 | set id = #{record.id,jdbcType=INTEGER}, 153 | name = #{record.name,jdbcType=VARCHAR} 154 | 155 | 156 | 157 | 158 | 159 | update e2_emp 160 | 161 | 162 | name = #{name,jdbcType=VARCHAR}, 163 | 164 | 165 | where id = #{id,jdbcType=INTEGER} 166 | 167 | 168 | update e2_emp 169 | set name = #{name,jdbcType=VARCHAR} 170 | where id = #{id,jdbcType=INTEGER} 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | and ${criterion.condition} 185 | 186 | 187 | and ${criterion.condition} #{criterion.value} 188 | 189 | 190 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 191 | 192 | 193 | and ${criterion.condition} 194 | 195 | #{listItem} 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | and ${criterion.condition} 214 | 215 | 216 | and ${criterion.condition} #{criterion.value} 217 | 218 | 219 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 220 | 221 | 222 | and ${criterion.condition} 223 | 224 | #{listItem} 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | id, name 237 | 238 | 239 | ${fields} 240 | 241 | 242 | 259 | 265 | 266 | delete from e2_emp 267 | where id = #{id,jdbcType=INTEGER} 268 | 269 | 270 | delete from e2_emp 271 | 272 | 273 | 274 | 275 | 276 | insert into e2_emp (id, name) 277 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}) 278 | 279 | 280 | insert into e2_emp 281 | 282 | 283 | id, 284 | 285 | 286 | name, 287 | 288 | 289 | 290 | 291 | #{id,jdbcType=INTEGER}, 292 | 293 | 294 | #{name,jdbcType=VARCHAR}, 295 | 296 | 297 | 298 | 304 | 305 | update e2_emp 306 | 307 | 308 | id = #{record.id,jdbcType=INTEGER}, 309 | 310 | 311 | name = #{record.name,jdbcType=VARCHAR}, 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | update e2_emp 320 | set id = #{record.id,jdbcType=INTEGER}, 321 | name = #{record.name,jdbcType=VARCHAR} 322 | 323 | 324 | 325 | 326 | 327 | update e2_emp 328 | 329 | 330 | name = #{name,jdbcType=VARCHAR}, 331 | 332 | 333 | where id = #{id,jdbcType=INTEGER} 334 | 335 | 336 | update e2_emp 337 | set name = #{name,jdbcType=VARCHAR} 338 | where id = #{id,jdbcType=INTEGER} 339 | 340 | -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/SalgradeempQuery.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class SalgradeempQuery { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | protected Integer pageNo = 1; 14 | 15 | protected Integer startRow; 16 | 17 | protected Integer pageSize = 10; 18 | 19 | protected String fields; 20 | 21 | public SalgradeempQuery() { 22 | oredCriteria = new ArrayList(); 23 | } 24 | 25 | public void setOrderByClause(String orderByClause) { 26 | this.orderByClause = orderByClause; 27 | } 28 | 29 | public String getOrderByClause() { 30 | return orderByClause; 31 | } 32 | 33 | public void setDistinct(boolean distinct) { 34 | this.distinct = distinct; 35 | } 36 | 37 | public boolean isDistinct() { 38 | return distinct; 39 | } 40 | 41 | public List getOredCriteria() { 42 | return oredCriteria; 43 | } 44 | 45 | public void or(Criteria criteria) { 46 | oredCriteria.add(criteria); 47 | } 48 | 49 | public Criteria or() { 50 | Criteria criteria = createCriteriaInternal(); 51 | oredCriteria.add(criteria); 52 | return criteria; 53 | } 54 | 55 | public Criteria createCriteria() { 56 | Criteria criteria = createCriteriaInternal(); 57 | if (oredCriteria.size() == 0) { 58 | oredCriteria.add(criteria); 59 | } 60 | return criteria; 61 | } 62 | 63 | protected Criteria createCriteriaInternal() { 64 | Criteria criteria = new Criteria(); 65 | return criteria; 66 | } 67 | 68 | public void clear() { 69 | oredCriteria.clear(); 70 | orderByClause = null; 71 | distinct = false; 72 | } 73 | 74 | public void setPageNo(Integer pageNo) { 75 | this.pageNo=pageNo; 76 | this.startRow = (pageNo-1)*this.pageSize; 77 | } 78 | 79 | public Integer getPageNo() { 80 | return pageNo; 81 | } 82 | 83 | public void setStartRow(Integer startRow) { 84 | this.startRow=startRow; 85 | } 86 | 87 | public Integer getStartRow() { 88 | return startRow; 89 | } 90 | 91 | public void setPageSize(Integer pageSize) { 92 | this.pageSize=pageSize; 93 | this.startRow = (pageNo-1)*this.pageSize; 94 | } 95 | 96 | public Integer getPageSize() { 97 | return pageSize; 98 | } 99 | 100 | public void setFields(String fields) { 101 | this.fields=fields; 102 | } 103 | 104 | public String getFields() { 105 | return fields; 106 | } 107 | 108 | protected abstract static class GeneratedCriteria { 109 | protected List criteria; 110 | 111 | protected GeneratedCriteria() { 112 | super(); 113 | criteria = new ArrayList(); 114 | } 115 | 116 | public boolean isValid() { 117 | return criteria.size() > 0; 118 | } 119 | 120 | public List getAllCriteria() { 121 | return criteria; 122 | } 123 | 124 | public List getCriteria() { 125 | return criteria; 126 | } 127 | 128 | protected void addCriterion(String condition) { 129 | if (condition == null) { 130 | throw new RuntimeException("Value for condition cannot be null"); 131 | } 132 | criteria.add(new Criterion(condition)); 133 | } 134 | 135 | protected void addCriterion(String condition, Object value, String property) { 136 | if (value == null) { 137 | throw new RuntimeException("Value for " + property + " cannot be null"); 138 | } 139 | criteria.add(new Criterion(condition, value)); 140 | } 141 | 142 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 143 | if (value1 == null || value2 == null) { 144 | throw new RuntimeException("Between values for " + property + " cannot be null"); 145 | } 146 | criteria.add(new Criterion(condition, value1, value2)); 147 | } 148 | 149 | public Criteria andGradeIsNull() { 150 | addCriterion("grade is null"); 151 | return (Criteria) this; 152 | } 153 | 154 | public Criteria andGradeIsNotNull() { 155 | addCriterion("grade is not null"); 156 | return (Criteria) this; 157 | } 158 | 159 | public Criteria andGradeEqualTo(Integer value) { 160 | addCriterion("grade =", value, "grade"); 161 | return (Criteria) this; 162 | } 163 | 164 | public Criteria andGradeNotEqualTo(Integer value) { 165 | addCriterion("grade <>", value, "grade"); 166 | return (Criteria) this; 167 | } 168 | 169 | public Criteria andGradeGreaterThan(Integer value) { 170 | addCriterion("grade >", value, "grade"); 171 | return (Criteria) this; 172 | } 173 | 174 | public Criteria andGradeGreaterThanOrEqualTo(Integer value) { 175 | addCriterion("grade >=", value, "grade"); 176 | return (Criteria) this; 177 | } 178 | 179 | public Criteria andGradeLessThan(Integer value) { 180 | addCriterion("grade <", value, "grade"); 181 | return (Criteria) this; 182 | } 183 | 184 | public Criteria andGradeLessThanOrEqualTo(Integer value) { 185 | addCriterion("grade <=", value, "grade"); 186 | return (Criteria) this; 187 | } 188 | 189 | public Criteria andGradeIn(List values) { 190 | addCriterion("grade in", values, "grade"); 191 | return (Criteria) this; 192 | } 193 | 194 | public Criteria andGradeNotIn(List values) { 195 | addCriterion("grade not in", values, "grade"); 196 | return (Criteria) this; 197 | } 198 | 199 | public Criteria andGradeBetween(Integer value1, Integer value2) { 200 | addCriterion("grade between", value1, value2, "grade"); 201 | return (Criteria) this; 202 | } 203 | 204 | public Criteria andGradeNotBetween(Integer value1, Integer value2) { 205 | addCriterion("grade not between", value1, value2, "grade"); 206 | return (Criteria) this; 207 | } 208 | 209 | public Criteria andLosalIsNull() { 210 | addCriterion("losal is null"); 211 | return (Criteria) this; 212 | } 213 | 214 | public Criteria andLosalIsNotNull() { 215 | addCriterion("losal is not null"); 216 | return (Criteria) this; 217 | } 218 | 219 | public Criteria andLosalEqualTo(Integer value) { 220 | addCriterion("losal =", value, "losal"); 221 | return (Criteria) this; 222 | } 223 | 224 | public Criteria andLosalNotEqualTo(Integer value) { 225 | addCriterion("losal <>", value, "losal"); 226 | return (Criteria) this; 227 | } 228 | 229 | public Criteria andLosalGreaterThan(Integer value) { 230 | addCriterion("losal >", value, "losal"); 231 | return (Criteria) this; 232 | } 233 | 234 | public Criteria andLosalGreaterThanOrEqualTo(Integer value) { 235 | addCriterion("losal >=", value, "losal"); 236 | return (Criteria) this; 237 | } 238 | 239 | public Criteria andLosalLessThan(Integer value) { 240 | addCriterion("losal <", value, "losal"); 241 | return (Criteria) this; 242 | } 243 | 244 | public Criteria andLosalLessThanOrEqualTo(Integer value) { 245 | addCriterion("losal <=", value, "losal"); 246 | return (Criteria) this; 247 | } 248 | 249 | public Criteria andLosalIn(List values) { 250 | addCriterion("losal in", values, "losal"); 251 | return (Criteria) this; 252 | } 253 | 254 | public Criteria andLosalNotIn(List values) { 255 | addCriterion("losal not in", values, "losal"); 256 | return (Criteria) this; 257 | } 258 | 259 | public Criteria andLosalBetween(Integer value1, Integer value2) { 260 | addCriterion("losal between", value1, value2, "losal"); 261 | return (Criteria) this; 262 | } 263 | 264 | public Criteria andLosalNotBetween(Integer value1, Integer value2) { 265 | addCriterion("losal not between", value1, value2, "losal"); 266 | return (Criteria) this; 267 | } 268 | 269 | public Criteria andHisalIsNull() { 270 | addCriterion("hisal is null"); 271 | return (Criteria) this; 272 | } 273 | 274 | public Criteria andHisalIsNotNull() { 275 | addCriterion("hisal is not null"); 276 | return (Criteria) this; 277 | } 278 | 279 | public Criteria andHisalEqualTo(Integer value) { 280 | addCriterion("hisal =", value, "hisal"); 281 | return (Criteria) this; 282 | } 283 | 284 | public Criteria andHisalNotEqualTo(Integer value) { 285 | addCriterion("hisal <>", value, "hisal"); 286 | return (Criteria) this; 287 | } 288 | 289 | public Criteria andHisalGreaterThan(Integer value) { 290 | addCriterion("hisal >", value, "hisal"); 291 | return (Criteria) this; 292 | } 293 | 294 | public Criteria andHisalGreaterThanOrEqualTo(Integer value) { 295 | addCriterion("hisal >=", value, "hisal"); 296 | return (Criteria) this; 297 | } 298 | 299 | public Criteria andHisalLessThan(Integer value) { 300 | addCriterion("hisal <", value, "hisal"); 301 | return (Criteria) this; 302 | } 303 | 304 | public Criteria andHisalLessThanOrEqualTo(Integer value) { 305 | addCriterion("hisal <=", value, "hisal"); 306 | return (Criteria) this; 307 | } 308 | 309 | public Criteria andHisalIn(List values) { 310 | addCriterion("hisal in", values, "hisal"); 311 | return (Criteria) this; 312 | } 313 | 314 | public Criteria andHisalNotIn(List values) { 315 | addCriterion("hisal not in", values, "hisal"); 316 | return (Criteria) this; 317 | } 318 | 319 | public Criteria andHisalBetween(Integer value1, Integer value2) { 320 | addCriterion("hisal between", value1, value2, "hisal"); 321 | return (Criteria) this; 322 | } 323 | 324 | public Criteria andHisalNotBetween(Integer value1, Integer value2) { 325 | addCriterion("hisal not between", value1, value2, "hisal"); 326 | return (Criteria) this; 327 | } 328 | } 329 | 330 | public static class Criteria extends GeneratedCriteria { 331 | 332 | protected Criteria() { 333 | super(); 334 | } 335 | } 336 | 337 | public static class Criterion { 338 | private String condition; 339 | 340 | private Object value; 341 | 342 | private Object secondValue; 343 | 344 | private boolean noValue; 345 | 346 | private boolean singleValue; 347 | 348 | private boolean betweenValue; 349 | 350 | private boolean listValue; 351 | 352 | private String typeHandler; 353 | 354 | public String getCondition() { 355 | return condition; 356 | } 357 | 358 | public Object getValue() { 359 | return value; 360 | } 361 | 362 | public Object getSecondValue() { 363 | return secondValue; 364 | } 365 | 366 | public boolean isNoValue() { 367 | return noValue; 368 | } 369 | 370 | public boolean isSingleValue() { 371 | return singleValue; 372 | } 373 | 374 | public boolean isBetweenValue() { 375 | return betweenValue; 376 | } 377 | 378 | public boolean isListValue() { 379 | return listValue; 380 | } 381 | 382 | public String getTypeHandler() { 383 | return typeHandler; 384 | } 385 | 386 | protected Criterion(String condition) { 387 | super(); 388 | this.condition = condition; 389 | this.typeHandler = null; 390 | this.noValue = true; 391 | } 392 | 393 | protected Criterion(String condition, Object value, String typeHandler) { 394 | super(); 395 | this.condition = condition; 396 | this.value = value; 397 | this.typeHandler = typeHandler; 398 | if (value instanceof List) { 399 | this.listValue = true; 400 | } else { 401 | this.singleValue = true; 402 | } 403 | } 404 | 405 | protected Criterion(String condition, Object value) { 406 | this(condition, value, null); 407 | } 408 | 409 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 410 | super(); 411 | this.condition = condition; 412 | this.value = value; 413 | this.secondValue = secondValue; 414 | this.typeHandler = typeHandler; 415 | this.betweenValue = true; 416 | } 417 | 418 | protected Criterion(String condition, Object value, Object secondValue) { 419 | this(condition, value, secondValue, null); 420 | } 421 | } 422 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/dept/DeptQuery.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.dept; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class DeptQuery { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | protected Integer pageNo = 1; 14 | 15 | protected Integer startRow; 16 | 17 | protected Integer pageSize = 10; 18 | 19 | protected String fields; 20 | 21 | public DeptQuery() { 22 | oredCriteria = new ArrayList(); 23 | } 24 | 25 | public void setOrderByClause(String orderByClause) { 26 | this.orderByClause = orderByClause; 27 | } 28 | 29 | public String getOrderByClause() { 30 | return orderByClause; 31 | } 32 | 33 | public void setDistinct(boolean distinct) { 34 | this.distinct = distinct; 35 | } 36 | 37 | public boolean isDistinct() { 38 | return distinct; 39 | } 40 | 41 | public List getOredCriteria() { 42 | return oredCriteria; 43 | } 44 | 45 | public void or(Criteria criteria) { 46 | oredCriteria.add(criteria); 47 | } 48 | 49 | public Criteria or() { 50 | Criteria criteria = createCriteriaInternal(); 51 | oredCriteria.add(criteria); 52 | return criteria; 53 | } 54 | 55 | public Criteria createCriteria() { 56 | Criteria criteria = createCriteriaInternal(); 57 | if (oredCriteria.size() == 0) { 58 | oredCriteria.add(criteria); 59 | } 60 | return criteria; 61 | } 62 | 63 | protected Criteria createCriteriaInternal() { 64 | Criteria criteria = new Criteria(); 65 | return criteria; 66 | } 67 | 68 | public void clear() { 69 | oredCriteria.clear(); 70 | orderByClause = null; 71 | distinct = false; 72 | } 73 | 74 | public void setPageNo(Integer pageNo) { 75 | this.pageNo=pageNo; 76 | this.startRow = (pageNo-1)*this.pageSize; 77 | } 78 | 79 | public Integer getPageNo() { 80 | return pageNo; 81 | } 82 | 83 | public void setStartRow(Integer startRow) { 84 | this.startRow=startRow; 85 | } 86 | 87 | public Integer getStartRow() { 88 | return startRow; 89 | } 90 | 91 | public void setPageSize(Integer pageSize) { 92 | this.pageSize=pageSize; 93 | this.startRow = (pageNo-1)*this.pageSize; 94 | } 95 | 96 | public Integer getPageSize() { 97 | return pageSize; 98 | } 99 | 100 | public void setFields(String fields) { 101 | this.fields=fields; 102 | } 103 | 104 | public String getFields() { 105 | return fields; 106 | } 107 | 108 | protected abstract static class GeneratedCriteria { 109 | protected List criteria; 110 | 111 | protected GeneratedCriteria() { 112 | super(); 113 | criteria = new ArrayList(); 114 | } 115 | 116 | public boolean isValid() { 117 | return criteria.size() > 0; 118 | } 119 | 120 | public List getAllCriteria() { 121 | return criteria; 122 | } 123 | 124 | public List getCriteria() { 125 | return criteria; 126 | } 127 | 128 | protected void addCriterion(String condition) { 129 | if (condition == null) { 130 | throw new RuntimeException("Value for condition cannot be null"); 131 | } 132 | criteria.add(new Criterion(condition)); 133 | } 134 | 135 | protected void addCriterion(String condition, Object value, String property) { 136 | if (value == null) { 137 | throw new RuntimeException("Value for " + property + " cannot be null"); 138 | } 139 | criteria.add(new Criterion(condition, value)); 140 | } 141 | 142 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 143 | if (value1 == null || value2 == null) { 144 | throw new RuntimeException("Between values for " + property + " cannot be null"); 145 | } 146 | criteria.add(new Criterion(condition, value1, value2)); 147 | } 148 | 149 | public Criteria andDeptnoIsNull() { 150 | addCriterion("deptno is null"); 151 | return (Criteria) this; 152 | } 153 | 154 | public Criteria andDeptnoIsNotNull() { 155 | addCriterion("deptno is not null"); 156 | return (Criteria) this; 157 | } 158 | 159 | public Criteria andDeptnoEqualTo(Integer value) { 160 | addCriterion("deptno =", value, "deptno"); 161 | return (Criteria) this; 162 | } 163 | 164 | public Criteria andDeptnoNotEqualTo(Integer value) { 165 | addCriterion("deptno <>", value, "deptno"); 166 | return (Criteria) this; 167 | } 168 | 169 | public Criteria andDeptnoGreaterThan(Integer value) { 170 | addCriterion("deptno >", value, "deptno"); 171 | return (Criteria) this; 172 | } 173 | 174 | public Criteria andDeptnoGreaterThanOrEqualTo(Integer value) { 175 | addCriterion("deptno >=", value, "deptno"); 176 | return (Criteria) this; 177 | } 178 | 179 | public Criteria andDeptnoLessThan(Integer value) { 180 | addCriterion("deptno <", value, "deptno"); 181 | return (Criteria) this; 182 | } 183 | 184 | public Criteria andDeptnoLessThanOrEqualTo(Integer value) { 185 | addCriterion("deptno <=", value, "deptno"); 186 | return (Criteria) this; 187 | } 188 | 189 | public Criteria andDeptnoIn(List values) { 190 | addCriterion("deptno in", values, "deptno"); 191 | return (Criteria) this; 192 | } 193 | 194 | public Criteria andDeptnoNotIn(List values) { 195 | addCriterion("deptno not in", values, "deptno"); 196 | return (Criteria) this; 197 | } 198 | 199 | public Criteria andDeptnoBetween(Integer value1, Integer value2) { 200 | addCriterion("deptno between", value1, value2, "deptno"); 201 | return (Criteria) this; 202 | } 203 | 204 | public Criteria andDeptnoNotBetween(Integer value1, Integer value2) { 205 | addCriterion("deptno not between", value1, value2, "deptno"); 206 | return (Criteria) this; 207 | } 208 | 209 | public Criteria andDnameIsNull() { 210 | addCriterion("dname is null"); 211 | return (Criteria) this; 212 | } 213 | 214 | public Criteria andDnameIsNotNull() { 215 | addCriterion("dname is not null"); 216 | return (Criteria) this; 217 | } 218 | 219 | public Criteria andDnameEqualTo(String value) { 220 | addCriterion("dname =", value, "dname"); 221 | return (Criteria) this; 222 | } 223 | 224 | public Criteria andDnameNotEqualTo(String value) { 225 | addCriterion("dname <>", value, "dname"); 226 | return (Criteria) this; 227 | } 228 | 229 | public Criteria andDnameGreaterThan(String value) { 230 | addCriterion("dname >", value, "dname"); 231 | return (Criteria) this; 232 | } 233 | 234 | public Criteria andDnameGreaterThanOrEqualTo(String value) { 235 | addCriterion("dname >=", value, "dname"); 236 | return (Criteria) this; 237 | } 238 | 239 | public Criteria andDnameLessThan(String value) { 240 | addCriterion("dname <", value, "dname"); 241 | return (Criteria) this; 242 | } 243 | 244 | public Criteria andDnameLessThanOrEqualTo(String value) { 245 | addCriterion("dname <=", value, "dname"); 246 | return (Criteria) this; 247 | } 248 | 249 | public Criteria andDnameLike(String value) { 250 | addCriterion("dname like", value, "dname"); 251 | return (Criteria) this; 252 | } 253 | 254 | public Criteria andDnameNotLike(String value) { 255 | addCriterion("dname not like", value, "dname"); 256 | return (Criteria) this; 257 | } 258 | 259 | public Criteria andDnameIn(List values) { 260 | addCriterion("dname in", values, "dname"); 261 | return (Criteria) this; 262 | } 263 | 264 | public Criteria andDnameNotIn(List values) { 265 | addCriterion("dname not in", values, "dname"); 266 | return (Criteria) this; 267 | } 268 | 269 | public Criteria andDnameBetween(String value1, String value2) { 270 | addCriterion("dname between", value1, value2, "dname"); 271 | return (Criteria) this; 272 | } 273 | 274 | public Criteria andDnameNotBetween(String value1, String value2) { 275 | addCriterion("dname not between", value1, value2, "dname"); 276 | return (Criteria) this; 277 | } 278 | 279 | public Criteria andLocIsNull() { 280 | addCriterion("loc is null"); 281 | return (Criteria) this; 282 | } 283 | 284 | public Criteria andLocIsNotNull() { 285 | addCriterion("loc is not null"); 286 | return (Criteria) this; 287 | } 288 | 289 | public Criteria andLocEqualTo(String value) { 290 | addCriterion("loc =", value, "loc"); 291 | return (Criteria) this; 292 | } 293 | 294 | public Criteria andLocNotEqualTo(String value) { 295 | addCriterion("loc <>", value, "loc"); 296 | return (Criteria) this; 297 | } 298 | 299 | public Criteria andLocGreaterThan(String value) { 300 | addCriterion("loc >", value, "loc"); 301 | return (Criteria) this; 302 | } 303 | 304 | public Criteria andLocGreaterThanOrEqualTo(String value) { 305 | addCriterion("loc >=", value, "loc"); 306 | return (Criteria) this; 307 | } 308 | 309 | public Criteria andLocLessThan(String value) { 310 | addCriterion("loc <", value, "loc"); 311 | return (Criteria) this; 312 | } 313 | 314 | public Criteria andLocLessThanOrEqualTo(String value) { 315 | addCriterion("loc <=", value, "loc"); 316 | return (Criteria) this; 317 | } 318 | 319 | public Criteria andLocLike(String value) { 320 | addCriterion("loc like", value, "loc"); 321 | return (Criteria) this; 322 | } 323 | 324 | public Criteria andLocNotLike(String value) { 325 | addCriterion("loc not like", value, "loc"); 326 | return (Criteria) this; 327 | } 328 | 329 | public Criteria andLocIn(List values) { 330 | addCriterion("loc in", values, "loc"); 331 | return (Criteria) this; 332 | } 333 | 334 | public Criteria andLocNotIn(List values) { 335 | addCriterion("loc not in", values, "loc"); 336 | return (Criteria) this; 337 | } 338 | 339 | public Criteria andLocBetween(String value1, String value2) { 340 | addCriterion("loc between", value1, value2, "loc"); 341 | return (Criteria) this; 342 | } 343 | 344 | public Criteria andLocNotBetween(String value1, String value2) { 345 | addCriterion("loc not between", value1, value2, "loc"); 346 | return (Criteria) this; 347 | } 348 | } 349 | 350 | public static class Criteria extends GeneratedCriteria { 351 | 352 | protected Criteria() { 353 | super(); 354 | } 355 | } 356 | 357 | public static class Criterion { 358 | private String condition; 359 | 360 | private Object value; 361 | 362 | private Object secondValue; 363 | 364 | private boolean noValue; 365 | 366 | private boolean singleValue; 367 | 368 | private boolean betweenValue; 369 | 370 | private boolean listValue; 371 | 372 | private String typeHandler; 373 | 374 | public String getCondition() { 375 | return condition; 376 | } 377 | 378 | public Object getValue() { 379 | return value; 380 | } 381 | 382 | public Object getSecondValue() { 383 | return secondValue; 384 | } 385 | 386 | public boolean isNoValue() { 387 | return noValue; 388 | } 389 | 390 | public boolean isSingleValue() { 391 | return singleValue; 392 | } 393 | 394 | public boolean isBetweenValue() { 395 | return betweenValue; 396 | } 397 | 398 | public boolean isListValue() { 399 | return listValue; 400 | } 401 | 402 | public String getTypeHandler() { 403 | return typeHandler; 404 | } 405 | 406 | protected Criterion(String condition) { 407 | super(); 408 | this.condition = condition; 409 | this.typeHandler = null; 410 | this.noValue = true; 411 | } 412 | 413 | protected Criterion(String condition, Object value, String typeHandler) { 414 | super(); 415 | this.condition = condition; 416 | this.value = value; 417 | this.typeHandler = typeHandler; 418 | if (value instanceof List) { 419 | this.listValue = true; 420 | } else { 421 | this.singleValue = true; 422 | } 423 | } 424 | 425 | protected Criterion(String condition, Object value) { 426 | this(condition, value, null); 427 | } 428 | 429 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 430 | super(); 431 | this.condition = condition; 432 | this.value = value; 433 | this.secondValue = secondValue; 434 | this.typeHandler = typeHandler; 435 | this.betweenValue = true; 436 | } 437 | 438 | protected Criterion(String condition, Object value, Object secondValue) { 439 | this(condition, value, secondValue, null); 440 | } 441 | } 442 | } -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/SalgradeempDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | and ${criterion.condition} 18 | 19 | 20 | and ${criterion.condition} #{criterion.value} 21 | 22 | 23 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 24 | 25 | 26 | and ${criterion.condition} 27 | 28 | #{listItem} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | and ${criterion.condition} 47 | 48 | 49 | and ${criterion.condition} #{criterion.value} 50 | 51 | 52 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 53 | 54 | 55 | and ${criterion.condition} 56 | 57 | #{listItem} 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | grade, losal, hisal 70 | 71 | 72 | ${fields} 73 | 74 | 75 | 92 | 98 | 99 | delete from salgradeemp 100 | where grade = #{grade,jdbcType=INTEGER} 101 | 102 | 103 | delete from salgradeemp 104 | 105 | 106 | 107 | 108 | 109 | insert into salgradeemp (grade, losal, hisal 110 | ) 111 | values (#{grade,jdbcType=INTEGER}, #{losal,jdbcType=INTEGER}, #{hisal,jdbcType=INTEGER} 112 | ) 113 | 114 | 115 | insert into salgradeemp 116 | 117 | 118 | grade, 119 | 120 | 121 | losal, 122 | 123 | 124 | hisal, 125 | 126 | 127 | 128 | 129 | #{grade,jdbcType=INTEGER}, 130 | 131 | 132 | #{losal,jdbcType=INTEGER}, 133 | 134 | 135 | #{hisal,jdbcType=INTEGER}, 136 | 137 | 138 | 139 | 145 | 146 | update salgradeemp 147 | 148 | 149 | grade = #{record.grade,jdbcType=INTEGER}, 150 | 151 | 152 | losal = #{record.losal,jdbcType=INTEGER}, 153 | 154 | 155 | hisal = #{record.hisal,jdbcType=INTEGER}, 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | update salgradeemp 164 | set grade = #{record.grade,jdbcType=INTEGER}, 165 | losal = #{record.losal,jdbcType=INTEGER}, 166 | hisal = #{record.hisal,jdbcType=INTEGER} 167 | 168 | 169 | 170 | 171 | 172 | update salgradeemp 173 | 174 | 175 | losal = #{losal,jdbcType=INTEGER}, 176 | 177 | 178 | hisal = #{hisal,jdbcType=INTEGER}, 179 | 180 | 181 | where grade = #{grade,jdbcType=INTEGER} 182 | 183 | 184 | update salgradeemp 185 | set losal = #{losal,jdbcType=INTEGER}, 186 | hisal = #{hisal,jdbcType=INTEGER} 187 | where grade = #{grade,jdbcType=INTEGER} 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | and ${criterion.condition} 203 | 204 | 205 | and ${criterion.condition} #{criterion.value} 206 | 207 | 208 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 209 | 210 | 211 | and ${criterion.condition} 212 | 213 | #{listItem} 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | and ${criterion.condition} 232 | 233 | 234 | and ${criterion.condition} #{criterion.value} 235 | 236 | 237 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 238 | 239 | 240 | and ${criterion.condition} 241 | 242 | #{listItem} 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | grade, losal, hisal 255 | 256 | 257 | ${fields} 258 | 259 | 260 | 277 | 283 | 284 | delete from salgradeemp 285 | where grade = #{grade,jdbcType=INTEGER} 286 | 287 | 288 | delete from salgradeemp 289 | 290 | 291 | 292 | 293 | 294 | insert into salgradeemp (grade, losal, hisal 295 | ) 296 | values (#{grade,jdbcType=INTEGER}, #{losal,jdbcType=INTEGER}, #{hisal,jdbcType=INTEGER} 297 | ) 298 | 299 | 300 | insert into salgradeemp 301 | 302 | 303 | grade, 304 | 305 | 306 | losal, 307 | 308 | 309 | hisal, 310 | 311 | 312 | 313 | 314 | #{grade,jdbcType=INTEGER}, 315 | 316 | 317 | #{losal,jdbcType=INTEGER}, 318 | 319 | 320 | #{hisal,jdbcType=INTEGER}, 321 | 322 | 323 | 324 | 330 | 331 | update salgradeemp 332 | 333 | 334 | grade = #{record.grade,jdbcType=INTEGER}, 335 | 336 | 337 | losal = #{record.losal,jdbcType=INTEGER}, 338 | 339 | 340 | hisal = #{record.hisal,jdbcType=INTEGER}, 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | update salgradeemp 349 | set grade = #{record.grade,jdbcType=INTEGER}, 350 | losal = #{record.losal,jdbcType=INTEGER}, 351 | hisal = #{record.hisal,jdbcType=INTEGER} 352 | 353 | 354 | 355 | 356 | 357 | update salgradeemp 358 | 359 | 360 | losal = #{losal,jdbcType=INTEGER}, 361 | 362 | 363 | hisal = #{hisal,jdbcType=INTEGER}, 364 | 365 | 366 | where grade = #{grade,jdbcType=INTEGER} 367 | 368 | 369 | update salgradeemp 370 | set losal = #{losal,jdbcType=INTEGER}, 371 | hisal = #{hisal,jdbcType=INTEGER} 372 | where grade = #{grade,jdbcType=INTEGER} 373 | 374 | -------------------------------------------------------------------------------- /src/cn/ssm/core/dao/emp/EmpEmpDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | and ${criterion.condition} 23 | 24 | 25 | and ${criterion.condition} #{criterion.value} 26 | 27 | 28 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 29 | 30 | 31 | and ${criterion.condition} 32 | 33 | #{listItem} 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | and ${criterion.condition} 52 | 53 | 54 | and ${criterion.condition} #{criterion.value} 55 | 56 | 57 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 58 | 59 | 60 | and ${criterion.condition} 61 | 62 | #{listItem} 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | empno, ename, job, mgr, hiredate, sal, COMM, deptno 75 | 76 | 77 | ${fields} 78 | 79 | 80 | 97 | 103 | 104 | delete from emp_emp 105 | where empno = #{empno,jdbcType=INTEGER} 106 | 107 | 108 | delete from emp_emp 109 | 110 | 111 | 112 | 113 | 114 | insert into emp_emp (empno, ename, job, 115 | mgr, hiredate, sal, COMM, 116 | deptno) 117 | values (#{empno,jdbcType=INTEGER}, #{ename,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR}, 118 | #{mgr,jdbcType=INTEGER}, #{hiredate,jdbcType=DATE}, #{sal,jdbcType=DECIMAL}, #{comm,jdbcType=DECIMAL}, 119 | #{deptno,jdbcType=INTEGER}) 120 | 121 | 122 | insert into emp_emp 123 | 124 | 125 | empno, 126 | 127 | 128 | ename, 129 | 130 | 131 | job, 132 | 133 | 134 | mgr, 135 | 136 | 137 | hiredate, 138 | 139 | 140 | sal, 141 | 142 | 143 | COMM, 144 | 145 | 146 | deptno, 147 | 148 | 149 | 150 | 151 | #{empno,jdbcType=INTEGER}, 152 | 153 | 154 | #{ename,jdbcType=VARCHAR}, 155 | 156 | 157 | #{job,jdbcType=VARCHAR}, 158 | 159 | 160 | #{mgr,jdbcType=INTEGER}, 161 | 162 | 163 | #{hiredate,jdbcType=DATE}, 164 | 165 | 166 | #{sal,jdbcType=DECIMAL}, 167 | 168 | 169 | #{comm,jdbcType=DECIMAL}, 170 | 171 | 172 | #{deptno,jdbcType=INTEGER}, 173 | 174 | 175 | 176 | 182 | 183 | update emp_emp 184 | 185 | 186 | empno = #{record.empno,jdbcType=INTEGER}, 187 | 188 | 189 | ename = #{record.ename,jdbcType=VARCHAR}, 190 | 191 | 192 | job = #{record.job,jdbcType=VARCHAR}, 193 | 194 | 195 | mgr = #{record.mgr,jdbcType=INTEGER}, 196 | 197 | 198 | hiredate = #{record.hiredate,jdbcType=DATE}, 199 | 200 | 201 | sal = #{record.sal,jdbcType=DECIMAL}, 202 | 203 | 204 | COMM = #{record.comm,jdbcType=DECIMAL}, 205 | 206 | 207 | deptno = #{record.deptno,jdbcType=INTEGER}, 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | update emp_emp 216 | set empno = #{record.empno,jdbcType=INTEGER}, 217 | ename = #{record.ename,jdbcType=VARCHAR}, 218 | job = #{record.job,jdbcType=VARCHAR}, 219 | mgr = #{record.mgr,jdbcType=INTEGER}, 220 | hiredate = #{record.hiredate,jdbcType=DATE}, 221 | sal = #{record.sal,jdbcType=DECIMAL}, 222 | COMM = #{record.comm,jdbcType=DECIMAL}, 223 | deptno = #{record.deptno,jdbcType=INTEGER} 224 | 225 | 226 | 227 | 228 | 229 | update emp_emp 230 | 231 | 232 | ename = #{ename,jdbcType=VARCHAR}, 233 | 234 | 235 | job = #{job,jdbcType=VARCHAR}, 236 | 237 | 238 | mgr = #{mgr,jdbcType=INTEGER}, 239 | 240 | 241 | hiredate = #{hiredate,jdbcType=DATE}, 242 | 243 | 244 | sal = #{sal,jdbcType=DECIMAL}, 245 | 246 | 247 | COMM = #{comm,jdbcType=DECIMAL}, 248 | 249 | 250 | deptno = #{deptno,jdbcType=INTEGER}, 251 | 252 | 253 | where empno = #{empno,jdbcType=INTEGER} 254 | 255 | 256 | update emp_emp 257 | set ename = #{ename,jdbcType=VARCHAR}, 258 | job = #{job,jdbcType=VARCHAR}, 259 | mgr = #{mgr,jdbcType=INTEGER}, 260 | hiredate = #{hiredate,jdbcType=DATE}, 261 | sal = #{sal,jdbcType=DECIMAL}, 262 | COMM = #{comm,jdbcType=DECIMAL}, 263 | deptno = #{deptno,jdbcType=INTEGER} 264 | where empno = #{empno,jdbcType=INTEGER} 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | and ${criterion.condition} 285 | 286 | 287 | and ${criterion.condition} #{criterion.value} 288 | 289 | 290 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 291 | 292 | 293 | and ${criterion.condition} 294 | 295 | #{listItem} 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | and ${criterion.condition} 314 | 315 | 316 | and ${criterion.condition} #{criterion.value} 317 | 318 | 319 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 320 | 321 | 322 | and ${criterion.condition} 323 | 324 | #{listItem} 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | empno, ename, job, mgr, hiredate, sal, COMM, deptno 337 | 338 | 339 | ${fields} 340 | 341 | 342 | 359 | 365 | 366 | delete from emp_emp 367 | where empno = #{empno,jdbcType=INTEGER} 368 | 369 | 370 | delete from emp_emp 371 | 372 | 373 | 374 | 375 | 376 | insert into emp_emp (empno, ename, job, 377 | mgr, hiredate, sal, COMM, 378 | deptno) 379 | values (#{empno,jdbcType=INTEGER}, #{ename,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR}, 380 | #{mgr,jdbcType=INTEGER}, #{hiredate,jdbcType=DATE}, #{sal,jdbcType=DECIMAL}, #{comm,jdbcType=DECIMAL}, 381 | #{deptno,jdbcType=INTEGER}) 382 | 383 | 384 | insert into emp_emp 385 | 386 | 387 | empno, 388 | 389 | 390 | ename, 391 | 392 | 393 | job, 394 | 395 | 396 | mgr, 397 | 398 | 399 | hiredate, 400 | 401 | 402 | sal, 403 | 404 | 405 | COMM, 406 | 407 | 408 | deptno, 409 | 410 | 411 | 412 | 413 | #{empno,jdbcType=INTEGER}, 414 | 415 | 416 | #{ename,jdbcType=VARCHAR}, 417 | 418 | 419 | #{job,jdbcType=VARCHAR}, 420 | 421 | 422 | #{mgr,jdbcType=INTEGER}, 423 | 424 | 425 | #{hiredate,jdbcType=DATE}, 426 | 427 | 428 | #{sal,jdbcType=DECIMAL}, 429 | 430 | 431 | #{comm,jdbcType=DECIMAL}, 432 | 433 | 434 | #{deptno,jdbcType=INTEGER}, 435 | 436 | 437 | 438 | 444 | 445 | update emp_emp 446 | 447 | 448 | empno = #{record.empno,jdbcType=INTEGER}, 449 | 450 | 451 | ename = #{record.ename,jdbcType=VARCHAR}, 452 | 453 | 454 | job = #{record.job,jdbcType=VARCHAR}, 455 | 456 | 457 | mgr = #{record.mgr,jdbcType=INTEGER}, 458 | 459 | 460 | hiredate = #{record.hiredate,jdbcType=DATE}, 461 | 462 | 463 | sal = #{record.sal,jdbcType=DECIMAL}, 464 | 465 | 466 | COMM = #{record.comm,jdbcType=DECIMAL}, 467 | 468 | 469 | deptno = #{record.deptno,jdbcType=INTEGER}, 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | update emp_emp 478 | set empno = #{record.empno,jdbcType=INTEGER}, 479 | ename = #{record.ename,jdbcType=VARCHAR}, 480 | job = #{record.job,jdbcType=VARCHAR}, 481 | mgr = #{record.mgr,jdbcType=INTEGER}, 482 | hiredate = #{record.hiredate,jdbcType=DATE}, 483 | sal = #{record.sal,jdbcType=DECIMAL}, 484 | COMM = #{record.comm,jdbcType=DECIMAL}, 485 | deptno = #{record.deptno,jdbcType=INTEGER} 486 | 487 | 488 | 489 | 490 | 491 | update emp_emp 492 | 493 | 494 | ename = #{ename,jdbcType=VARCHAR}, 495 | 496 | 497 | job = #{job,jdbcType=VARCHAR}, 498 | 499 | 500 | mgr = #{mgr,jdbcType=INTEGER}, 501 | 502 | 503 | hiredate = #{hiredate,jdbcType=DATE}, 504 | 505 | 506 | sal = #{sal,jdbcType=DECIMAL}, 507 | 508 | 509 | COMM = #{comm,jdbcType=DECIMAL}, 510 | 511 | 512 | deptno = #{deptno,jdbcType=INTEGER}, 513 | 514 | 515 | where empno = #{empno,jdbcType=INTEGER} 516 | 517 | 518 | update emp_emp 519 | set ename = #{ename,jdbcType=VARCHAR}, 520 | job = #{job,jdbcType=VARCHAR}, 521 | mgr = #{mgr,jdbcType=INTEGER}, 522 | hiredate = #{hiredate,jdbcType=DATE}, 523 | sal = #{sal,jdbcType=DECIMAL}, 524 | COMM = #{comm,jdbcType=DECIMAL}, 525 | deptno = #{deptno,jdbcType=INTEGER} 526 | where empno = #{empno,jdbcType=INTEGER} 527 | 528 | -------------------------------------------------------------------------------- /src/cn/ssm/core/bean/emp/EmpEmpQuery.java: -------------------------------------------------------------------------------- 1 | package cn.ssm.core.bean.emp; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.ArrayList; 5 | import java.util.Date; 6 | import java.util.Iterator; 7 | import java.util.List; 8 | 9 | public class EmpEmpQuery { 10 | protected String orderByClause; 11 | 12 | protected boolean distinct; 13 | 14 | protected List oredCriteria; 15 | 16 | protected Integer pageNo = 1; 17 | 18 | protected Integer startRow; 19 | 20 | protected Integer pageSize = 10; 21 | 22 | protected String fields; 23 | 24 | public EmpEmpQuery() { 25 | oredCriteria = new ArrayList(); 26 | } 27 | 28 | public void setOrderByClause(String orderByClause) { 29 | this.orderByClause = orderByClause; 30 | } 31 | 32 | public String getOrderByClause() { 33 | return orderByClause; 34 | } 35 | 36 | public void setDistinct(boolean distinct) { 37 | this.distinct = distinct; 38 | } 39 | 40 | public boolean isDistinct() { 41 | return distinct; 42 | } 43 | 44 | public List getOredCriteria() { 45 | return oredCriteria; 46 | } 47 | 48 | public void or(Criteria criteria) { 49 | oredCriteria.add(criteria); 50 | } 51 | 52 | public Criteria or() { 53 | Criteria criteria = createCriteriaInternal(); 54 | oredCriteria.add(criteria); 55 | return criteria; 56 | } 57 | 58 | public Criteria createCriteria() { 59 | Criteria criteria = createCriteriaInternal(); 60 | if (oredCriteria.size() == 0) { 61 | oredCriteria.add(criteria); 62 | } 63 | return criteria; 64 | } 65 | 66 | protected Criteria createCriteriaInternal() { 67 | Criteria criteria = new Criteria(); 68 | return criteria; 69 | } 70 | 71 | public void clear() { 72 | oredCriteria.clear(); 73 | orderByClause = null; 74 | distinct = false; 75 | } 76 | 77 | public void setPageNo(Integer pageNo) { 78 | this.pageNo=pageNo; 79 | this.startRow = (pageNo-1)*this.pageSize; 80 | } 81 | 82 | public Integer getPageNo() { 83 | return pageNo; 84 | } 85 | 86 | public void setStartRow(Integer startRow) { 87 | this.startRow=startRow; 88 | } 89 | 90 | public Integer getStartRow() { 91 | return startRow; 92 | } 93 | 94 | public void setPageSize(Integer pageSize) { 95 | this.pageSize=pageSize; 96 | this.startRow = (pageNo-1)*this.pageSize; 97 | } 98 | 99 | public Integer getPageSize() { 100 | return pageSize; 101 | } 102 | 103 | public void setFields(String fields) { 104 | this.fields=fields; 105 | } 106 | 107 | public String getFields() { 108 | return fields; 109 | } 110 | 111 | protected abstract static class GeneratedCriteria { 112 | protected List criteria; 113 | 114 | protected GeneratedCriteria() { 115 | super(); 116 | criteria = new ArrayList(); 117 | } 118 | 119 | public boolean isValid() { 120 | return criteria.size() > 0; 121 | } 122 | 123 | public List getAllCriteria() { 124 | return criteria; 125 | } 126 | 127 | public List getCriteria() { 128 | return criteria; 129 | } 130 | 131 | protected void addCriterion(String condition) { 132 | if (condition == null) { 133 | throw new RuntimeException("Value for condition cannot be null"); 134 | } 135 | criteria.add(new Criterion(condition)); 136 | } 137 | 138 | protected void addCriterion(String condition, Object value, String property) { 139 | if (value == null) { 140 | throw new RuntimeException("Value for " + property + " cannot be null"); 141 | } 142 | criteria.add(new Criterion(condition, value)); 143 | } 144 | 145 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 146 | if (value1 == null || value2 == null) { 147 | throw new RuntimeException("Between values for " + property + " cannot be null"); 148 | } 149 | criteria.add(new Criterion(condition, value1, value2)); 150 | } 151 | 152 | protected void addCriterionForJDBCDate(String condition, Date value, String property) { 153 | if (value == null) { 154 | throw new RuntimeException("Value for " + property + " cannot be null"); 155 | } 156 | addCriterion(condition, new java.sql.Date(value.getTime()), property); 157 | } 158 | 159 | protected void addCriterionForJDBCDate(String condition, List values, String property) { 160 | if (values == null || values.size() == 0) { 161 | throw new RuntimeException("Value list for " + property + " cannot be null or empty"); 162 | } 163 | List dateList = new ArrayList(); 164 | Iterator iter = values.iterator(); 165 | while (iter.hasNext()) { 166 | dateList.add(new java.sql.Date(iter.next().getTime())); 167 | } 168 | addCriterion(condition, dateList, property); 169 | } 170 | 171 | protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) { 172 | if (value1 == null || value2 == null) { 173 | throw new RuntimeException("Between values for " + property + " cannot be null"); 174 | } 175 | addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property); 176 | } 177 | 178 | public Criteria andEmpnoIsNull() { 179 | addCriterion("empno is null"); 180 | return (Criteria) this; 181 | } 182 | 183 | public Criteria andEmpnoIsNotNull() { 184 | addCriterion("empno is not null"); 185 | return (Criteria) this; 186 | } 187 | 188 | public Criteria andEmpnoEqualTo(Integer value) { 189 | addCriterion("empno =", value, "empno"); 190 | return (Criteria) this; 191 | } 192 | 193 | public Criteria andEmpnoNotEqualTo(Integer value) { 194 | addCriterion("empno <>", value, "empno"); 195 | return (Criteria) this; 196 | } 197 | 198 | public Criteria andEmpnoGreaterThan(Integer value) { 199 | addCriterion("empno >", value, "empno"); 200 | return (Criteria) this; 201 | } 202 | 203 | public Criteria andEmpnoGreaterThanOrEqualTo(Integer value) { 204 | addCriterion("empno >=", value, "empno"); 205 | return (Criteria) this; 206 | } 207 | 208 | public Criteria andEmpnoLessThan(Integer value) { 209 | addCriterion("empno <", value, "empno"); 210 | return (Criteria) this; 211 | } 212 | 213 | public Criteria andEmpnoLessThanOrEqualTo(Integer value) { 214 | addCriterion("empno <=", value, "empno"); 215 | return (Criteria) this; 216 | } 217 | 218 | public Criteria andEmpnoIn(List values) { 219 | addCriterion("empno in", values, "empno"); 220 | return (Criteria) this; 221 | } 222 | 223 | public Criteria andEmpnoNotIn(List values) { 224 | addCriterion("empno not in", values, "empno"); 225 | return (Criteria) this; 226 | } 227 | 228 | public Criteria andEmpnoBetween(Integer value1, Integer value2) { 229 | addCriterion("empno between", value1, value2, "empno"); 230 | return (Criteria) this; 231 | } 232 | 233 | public Criteria andEmpnoNotBetween(Integer value1, Integer value2) { 234 | addCriterion("empno not between", value1, value2, "empno"); 235 | return (Criteria) this; 236 | } 237 | 238 | public Criteria andEnameIsNull() { 239 | addCriterion("ename is null"); 240 | return (Criteria) this; 241 | } 242 | 243 | public Criteria andEnameIsNotNull() { 244 | addCriterion("ename is not null"); 245 | return (Criteria) this; 246 | } 247 | 248 | public Criteria andEnameEqualTo(String value) { 249 | addCriterion("ename =", value, "ename"); 250 | return (Criteria) this; 251 | } 252 | 253 | public Criteria andEnameNotEqualTo(String value) { 254 | addCriterion("ename <>", value, "ename"); 255 | return (Criteria) this; 256 | } 257 | 258 | public Criteria andEnameGreaterThan(String value) { 259 | addCriterion("ename >", value, "ename"); 260 | return (Criteria) this; 261 | } 262 | 263 | public Criteria andEnameGreaterThanOrEqualTo(String value) { 264 | addCriterion("ename >=", value, "ename"); 265 | return (Criteria) this; 266 | } 267 | 268 | public Criteria andEnameLessThan(String value) { 269 | addCriterion("ename <", value, "ename"); 270 | return (Criteria) this; 271 | } 272 | 273 | public Criteria andEnameLessThanOrEqualTo(String value) { 274 | addCriterion("ename <=", value, "ename"); 275 | return (Criteria) this; 276 | } 277 | 278 | public Criteria andEnameLike(String value) { 279 | addCriterion("ename like", value, "ename"); 280 | return (Criteria) this; 281 | } 282 | 283 | public Criteria andEnameNotLike(String value) { 284 | addCriterion("ename not like", value, "ename"); 285 | return (Criteria) this; 286 | } 287 | 288 | public Criteria andEnameIn(List values) { 289 | addCriterion("ename in", values, "ename"); 290 | return (Criteria) this; 291 | } 292 | 293 | public Criteria andEnameNotIn(List values) { 294 | addCriterion("ename not in", values, "ename"); 295 | return (Criteria) this; 296 | } 297 | 298 | public Criteria andEnameBetween(String value1, String value2) { 299 | addCriterion("ename between", value1, value2, "ename"); 300 | return (Criteria) this; 301 | } 302 | 303 | public Criteria andEnameNotBetween(String value1, String value2) { 304 | addCriterion("ename not between", value1, value2, "ename"); 305 | return (Criteria) this; 306 | } 307 | 308 | public Criteria andJobIsNull() { 309 | addCriterion("job is null"); 310 | return (Criteria) this; 311 | } 312 | 313 | public Criteria andJobIsNotNull() { 314 | addCriterion("job is not null"); 315 | return (Criteria) this; 316 | } 317 | 318 | public Criteria andJobEqualTo(String value) { 319 | addCriterion("job =", value, "job"); 320 | return (Criteria) this; 321 | } 322 | 323 | public Criteria andJobNotEqualTo(String value) { 324 | addCriterion("job <>", value, "job"); 325 | return (Criteria) this; 326 | } 327 | 328 | public Criteria andJobGreaterThan(String value) { 329 | addCriterion("job >", value, "job"); 330 | return (Criteria) this; 331 | } 332 | 333 | public Criteria andJobGreaterThanOrEqualTo(String value) { 334 | addCriterion("job >=", value, "job"); 335 | return (Criteria) this; 336 | } 337 | 338 | public Criteria andJobLessThan(String value) { 339 | addCriterion("job <", value, "job"); 340 | return (Criteria) this; 341 | } 342 | 343 | public Criteria andJobLessThanOrEqualTo(String value) { 344 | addCriterion("job <=", value, "job"); 345 | return (Criteria) this; 346 | } 347 | 348 | public Criteria andJobLike(String value) { 349 | addCriterion("job like", value, "job"); 350 | return (Criteria) this; 351 | } 352 | 353 | public Criteria andJobNotLike(String value) { 354 | addCriterion("job not like", value, "job"); 355 | return (Criteria) this; 356 | } 357 | 358 | public Criteria andJobIn(List values) { 359 | addCriterion("job in", values, "job"); 360 | return (Criteria) this; 361 | } 362 | 363 | public Criteria andJobNotIn(List values) { 364 | addCriterion("job not in", values, "job"); 365 | return (Criteria) this; 366 | } 367 | 368 | public Criteria andJobBetween(String value1, String value2) { 369 | addCriterion("job between", value1, value2, "job"); 370 | return (Criteria) this; 371 | } 372 | 373 | public Criteria andJobNotBetween(String value1, String value2) { 374 | addCriterion("job not between", value1, value2, "job"); 375 | return (Criteria) this; 376 | } 377 | 378 | public Criteria andMgrIsNull() { 379 | addCriterion("mgr is null"); 380 | return (Criteria) this; 381 | } 382 | 383 | public Criteria andMgrIsNotNull() { 384 | addCriterion("mgr is not null"); 385 | return (Criteria) this; 386 | } 387 | 388 | public Criteria andMgrEqualTo(Integer value) { 389 | addCriterion("mgr =", value, "mgr"); 390 | return (Criteria) this; 391 | } 392 | 393 | public Criteria andMgrNotEqualTo(Integer value) { 394 | addCriterion("mgr <>", value, "mgr"); 395 | return (Criteria) this; 396 | } 397 | 398 | public Criteria andMgrGreaterThan(Integer value) { 399 | addCriterion("mgr >", value, "mgr"); 400 | return (Criteria) this; 401 | } 402 | 403 | public Criteria andMgrGreaterThanOrEqualTo(Integer value) { 404 | addCriterion("mgr >=", value, "mgr"); 405 | return (Criteria) this; 406 | } 407 | 408 | public Criteria andMgrLessThan(Integer value) { 409 | addCriterion("mgr <", value, "mgr"); 410 | return (Criteria) this; 411 | } 412 | 413 | public Criteria andMgrLessThanOrEqualTo(Integer value) { 414 | addCriterion("mgr <=", value, "mgr"); 415 | return (Criteria) this; 416 | } 417 | 418 | public Criteria andMgrIn(List values) { 419 | addCriterion("mgr in", values, "mgr"); 420 | return (Criteria) this; 421 | } 422 | 423 | public Criteria andMgrNotIn(List values) { 424 | addCriterion("mgr not in", values, "mgr"); 425 | return (Criteria) this; 426 | } 427 | 428 | public Criteria andMgrBetween(Integer value1, Integer value2) { 429 | addCriterion("mgr between", value1, value2, "mgr"); 430 | return (Criteria) this; 431 | } 432 | 433 | public Criteria andMgrNotBetween(Integer value1, Integer value2) { 434 | addCriterion("mgr not between", value1, value2, "mgr"); 435 | return (Criteria) this; 436 | } 437 | 438 | public Criteria andHiredateIsNull() { 439 | addCriterion("hiredate is null"); 440 | return (Criteria) this; 441 | } 442 | 443 | public Criteria andHiredateIsNotNull() { 444 | addCriterion("hiredate is not null"); 445 | return (Criteria) this; 446 | } 447 | 448 | public Criteria andHiredateEqualTo(Date value) { 449 | addCriterionForJDBCDate("hiredate =", value, "hiredate"); 450 | return (Criteria) this; 451 | } 452 | 453 | public Criteria andHiredateNotEqualTo(Date value) { 454 | addCriterionForJDBCDate("hiredate <>", value, "hiredate"); 455 | return (Criteria) this; 456 | } 457 | 458 | public Criteria andHiredateGreaterThan(Date value) { 459 | addCriterionForJDBCDate("hiredate >", value, "hiredate"); 460 | return (Criteria) this; 461 | } 462 | 463 | public Criteria andHiredateGreaterThanOrEqualTo(Date value) { 464 | addCriterionForJDBCDate("hiredate >=", value, "hiredate"); 465 | return (Criteria) this; 466 | } 467 | 468 | public Criteria andHiredateLessThan(Date value) { 469 | addCriterionForJDBCDate("hiredate <", value, "hiredate"); 470 | return (Criteria) this; 471 | } 472 | 473 | public Criteria andHiredateLessThanOrEqualTo(Date value) { 474 | addCriterionForJDBCDate("hiredate <=", value, "hiredate"); 475 | return (Criteria) this; 476 | } 477 | 478 | public Criteria andHiredateIn(List values) { 479 | addCriterionForJDBCDate("hiredate in", values, "hiredate"); 480 | return (Criteria) this; 481 | } 482 | 483 | public Criteria andHiredateNotIn(List values) { 484 | addCriterionForJDBCDate("hiredate not in", values, "hiredate"); 485 | return (Criteria) this; 486 | } 487 | 488 | public Criteria andHiredateBetween(Date value1, Date value2) { 489 | addCriterionForJDBCDate("hiredate between", value1, value2, "hiredate"); 490 | return (Criteria) this; 491 | } 492 | 493 | public Criteria andHiredateNotBetween(Date value1, Date value2) { 494 | addCriterionForJDBCDate("hiredate not between", value1, value2, "hiredate"); 495 | return (Criteria) this; 496 | } 497 | 498 | public Criteria andSalIsNull() { 499 | addCriterion("sal is null"); 500 | return (Criteria) this; 501 | } 502 | 503 | public Criteria andSalIsNotNull() { 504 | addCriterion("sal is not null"); 505 | return (Criteria) this; 506 | } 507 | 508 | public Criteria andSalEqualTo(BigDecimal value) { 509 | addCriterion("sal =", value, "sal"); 510 | return (Criteria) this; 511 | } 512 | 513 | public Criteria andSalNotEqualTo(BigDecimal value) { 514 | addCriterion("sal <>", value, "sal"); 515 | return (Criteria) this; 516 | } 517 | 518 | public Criteria andSalGreaterThan(BigDecimal value) { 519 | addCriterion("sal >", value, "sal"); 520 | return (Criteria) this; 521 | } 522 | 523 | public Criteria andSalGreaterThanOrEqualTo(BigDecimal value) { 524 | addCriterion("sal >=", value, "sal"); 525 | return (Criteria) this; 526 | } 527 | 528 | public Criteria andSalLessThan(BigDecimal value) { 529 | addCriterion("sal <", value, "sal"); 530 | return (Criteria) this; 531 | } 532 | 533 | public Criteria andSalLessThanOrEqualTo(BigDecimal value) { 534 | addCriterion("sal <=", value, "sal"); 535 | return (Criteria) this; 536 | } 537 | 538 | public Criteria andSalIn(List values) { 539 | addCriterion("sal in", values, "sal"); 540 | return (Criteria) this; 541 | } 542 | 543 | public Criteria andSalNotIn(List values) { 544 | addCriterion("sal not in", values, "sal"); 545 | return (Criteria) this; 546 | } 547 | 548 | public Criteria andSalBetween(BigDecimal value1, BigDecimal value2) { 549 | addCriterion("sal between", value1, value2, "sal"); 550 | return (Criteria) this; 551 | } 552 | 553 | public Criteria andSalNotBetween(BigDecimal value1, BigDecimal value2) { 554 | addCriterion("sal not between", value1, value2, "sal"); 555 | return (Criteria) this; 556 | } 557 | 558 | public Criteria andCommIsNull() { 559 | addCriterion("COMM is null"); 560 | return (Criteria) this; 561 | } 562 | 563 | public Criteria andCommIsNotNull() { 564 | addCriterion("COMM is not null"); 565 | return (Criteria) this; 566 | } 567 | 568 | public Criteria andCommEqualTo(BigDecimal value) { 569 | addCriterion("COMM =", value, "comm"); 570 | return (Criteria) this; 571 | } 572 | 573 | public Criteria andCommNotEqualTo(BigDecimal value) { 574 | addCriterion("COMM <>", value, "comm"); 575 | return (Criteria) this; 576 | } 577 | 578 | public Criteria andCommGreaterThan(BigDecimal value) { 579 | addCriterion("COMM >", value, "comm"); 580 | return (Criteria) this; 581 | } 582 | 583 | public Criteria andCommGreaterThanOrEqualTo(BigDecimal value) { 584 | addCriterion("COMM >=", value, "comm"); 585 | return (Criteria) this; 586 | } 587 | 588 | public Criteria andCommLessThan(BigDecimal value) { 589 | addCriterion("COMM <", value, "comm"); 590 | return (Criteria) this; 591 | } 592 | 593 | public Criteria andCommLessThanOrEqualTo(BigDecimal value) { 594 | addCriterion("COMM <=", value, "comm"); 595 | return (Criteria) this; 596 | } 597 | 598 | public Criteria andCommIn(List values) { 599 | addCriterion("COMM in", values, "comm"); 600 | return (Criteria) this; 601 | } 602 | 603 | public Criteria andCommNotIn(List values) { 604 | addCriterion("COMM not in", values, "comm"); 605 | return (Criteria) this; 606 | } 607 | 608 | public Criteria andCommBetween(BigDecimal value1, BigDecimal value2) { 609 | addCriterion("COMM between", value1, value2, "comm"); 610 | return (Criteria) this; 611 | } 612 | 613 | public Criteria andCommNotBetween(BigDecimal value1, BigDecimal value2) { 614 | addCriterion("COMM not between", value1, value2, "comm"); 615 | return (Criteria) this; 616 | } 617 | 618 | public Criteria andDeptnoIsNull() { 619 | addCriterion("deptno is null"); 620 | return (Criteria) this; 621 | } 622 | 623 | public Criteria andDeptnoIsNotNull() { 624 | addCriterion("deptno is not null"); 625 | return (Criteria) this; 626 | } 627 | 628 | public Criteria andDeptnoEqualTo(Integer value) { 629 | addCriterion("deptno =", value, "deptno"); 630 | return (Criteria) this; 631 | } 632 | 633 | public Criteria andDeptnoNotEqualTo(Integer value) { 634 | addCriterion("deptno <>", value, "deptno"); 635 | return (Criteria) this; 636 | } 637 | 638 | public Criteria andDeptnoGreaterThan(Integer value) { 639 | addCriterion("deptno >", value, "deptno"); 640 | return (Criteria) this; 641 | } 642 | 643 | public Criteria andDeptnoGreaterThanOrEqualTo(Integer value) { 644 | addCriterion("deptno >=", value, "deptno"); 645 | return (Criteria) this; 646 | } 647 | 648 | public Criteria andDeptnoLessThan(Integer value) { 649 | addCriterion("deptno <", value, "deptno"); 650 | return (Criteria) this; 651 | } 652 | 653 | public Criteria andDeptnoLessThanOrEqualTo(Integer value) { 654 | addCriterion("deptno <=", value, "deptno"); 655 | return (Criteria) this; 656 | } 657 | 658 | public Criteria andDeptnoIn(List values) { 659 | addCriterion("deptno in", values, "deptno"); 660 | return (Criteria) this; 661 | } 662 | 663 | public Criteria andDeptnoNotIn(List values) { 664 | addCriterion("deptno not in", values, "deptno"); 665 | return (Criteria) this; 666 | } 667 | 668 | public Criteria andDeptnoBetween(Integer value1, Integer value2) { 669 | addCriterion("deptno between", value1, value2, "deptno"); 670 | return (Criteria) this; 671 | } 672 | 673 | public Criteria andDeptnoNotBetween(Integer value1, Integer value2) { 674 | addCriterion("deptno not between", value1, value2, "deptno"); 675 | return (Criteria) this; 676 | } 677 | } 678 | 679 | public static class Criteria extends GeneratedCriteria { 680 | 681 | protected Criteria() { 682 | super(); 683 | } 684 | } 685 | 686 | public static class Criterion { 687 | private String condition; 688 | 689 | private Object value; 690 | 691 | private Object secondValue; 692 | 693 | private boolean noValue; 694 | 695 | private boolean singleValue; 696 | 697 | private boolean betweenValue; 698 | 699 | private boolean listValue; 700 | 701 | private String typeHandler; 702 | 703 | public String getCondition() { 704 | return condition; 705 | } 706 | 707 | public Object getValue() { 708 | return value; 709 | } 710 | 711 | public Object getSecondValue() { 712 | return secondValue; 713 | } 714 | 715 | public boolean isNoValue() { 716 | return noValue; 717 | } 718 | 719 | public boolean isSingleValue() { 720 | return singleValue; 721 | } 722 | 723 | public boolean isBetweenValue() { 724 | return betweenValue; 725 | } 726 | 727 | public boolean isListValue() { 728 | return listValue; 729 | } 730 | 731 | public String getTypeHandler() { 732 | return typeHandler; 733 | } 734 | 735 | protected Criterion(String condition) { 736 | super(); 737 | this.condition = condition; 738 | this.typeHandler = null; 739 | this.noValue = true; 740 | } 741 | 742 | protected Criterion(String condition, Object value, String typeHandler) { 743 | super(); 744 | this.condition = condition; 745 | this.value = value; 746 | this.typeHandler = typeHandler; 747 | if (value instanceof List) { 748 | this.listValue = true; 749 | } else { 750 | this.singleValue = true; 751 | } 752 | } 753 | 754 | protected Criterion(String condition, Object value) { 755 | this(condition, value, null); 756 | } 757 | 758 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 759 | super(); 760 | this.condition = condition; 761 | this.value = value; 762 | this.secondValue = secondValue; 763 | this.typeHandler = typeHandler; 764 | this.betweenValue = true; 765 | } 766 | 767 | protected Criterion(String condition, Object value, Object secondValue) { 768 | this(condition, value, secondValue, null); 769 | } 770 | } 771 | } --------------------------------------------------------------------------------