@Test
public void Testselectbyexample () {
Itemsexample itemsexample = new Itemsexample ();
Itemsexample.criteria Criteria = Itemsexample.createcriteria ();
Fuzzy query
Criteria.andnamelike ("% pen%");
Criteria.andnameequalto ("desktop");
list<items> list = Itemsmapper.selectbyexample (itemsexample);
SYSTEM.OUT.PRINTLN (list);
}
Press primary key to update all properties
@Test
public void Testupdatebyprimarykey () {
Items items = Itemsmapper.selectbyprimarykey (1);
Itemsmapper.updatebyprimarykey (items);
}
Press primary key, update not empty property
@Test
public void Testupdatebyprimarykeyselective () {
Items items = new items ();
Itemsmapper.updatebyprimarykeyselective (items);
}
Update all properties by condition; example: condition; recored: Update Object
@Test
public void Testupdatebyprimarykeya () {
Items record = null;
itemsexample example = null;
Itemsmapper.updatebyexampleselective (record, example);
}
Order by
@Test
public void Testfindall () {
itemsexample example = new Itemsexample ();
Example.setorderbyclause ("Createtime desc");
Itemsmapper.selectbyexample (example);
}
An important way to generate mapper interfaces for reverse engineering