Git Product home page Git Product logo

mybatis-generator-my-plugin's Introduction

mybatis-generator-my-plugin

有索引的尽量不要有null

mybatis-generator 插件扩展

  • java中tinyint(1)对应Boolean
  • 动态查询(where条件构建example不用检查有没有值)
  • Example增强(支持example链式调用)
  • Model增强(新缯内部类Column,asc(),desc())
  • 分页参数支持
  • xml Mapper文件覆盖(原来是append操作)
  • 批量新增
  • 批量更新
  • 支持形如 a like ‘123%’ or a like '234%'的语句
  • 生成Service与ServiceImpl

以下是默认实现的例子

当值为null时为不会构造条件

List<TaskAck> taskAckList = selectByExample(new TaskAckExample()
    .orderBy(TaskAck.Column.ackId.desc())
    .createCriteria()
    .andTaskIdEqualTo(submitAck.getTaskId())
    .andVendorIdEqualTo(submitAck.getVendorId())
    .andAckStatusIn(taskAckStatusList)
    .example());

以下是V2版本的例子(不会每个model对应一个example)

当值为null时为不会构造条件

Example example = new Example().and()
        .eq(UserTest.Column.age, null)
        .example();
example.or().eq(UserTest.Column.age,null);
List<UserTest> test = userTestService.selectByExample(example);

mybatis-generator-my-plugin's People

Contributors

hugozhang avatar lzhbruce avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lzhbruce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.