Giter VIP home page Giter VIP logo

autodate's Introduction

MyBatis自动插入日期插件

MyBatis Auto Date Plugin

Build Status Coverage Status Dependency Status Maven central License Stack Overflow Project Stats

mybatis


Document:


描述:本插件主要是为了给Insert和Update语句自动添加上当前时间,方便开发人员开发。

1. 使用方式:在mybatis配置文件中加入如下配置,就完成了。

<plugins>
	<plugin interceptor="com.chrhc.mybatis.autodate.interceptor.AutoDateInterceptor">
		<property name="createDateColumn" value="create_date"/>
		<property name="updateDateColumn" value="update_date"/>
	</plugin>
</plugins>

2. 对插件配置的说明:

create_date和update_date代表数据库表中的创建时间和更新时间,这两个可以只配置一个,也可以两个都配置。
如果两个都不配置,则相当于插件不起作用。

3. 效果:

之前:insert into smart_user(id, name, password, version)values(?, ?, ?, ?)

之后:INSERT INTO smart_user (id, name, password, version, create_date) VALUES (?, ?, ?, ?, {ts '2016-06-23 15:01:05.55'})

之前:update smart_user set version = ? where id = ?

之后:UPDATE smart_user SET version = ?, update_date = {ts '2016-06-23 15:33:03.644'} WHERE id = ?


4.关于插件:

如果您有什么建议或者意见,欢迎留言,也欢迎pull request,作者会将你优秀的**加入到插件里面来,为其他人更好的解决问题。

5.关于作者:

作者QQ:605162215
作者邮箱:[email protected]

autodate's People

Contributors

xjs1919 avatar

Watchers

James Cloos avatar  avatar

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.