use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testSelectByExample.
@Test
public void testSelectByExample() throws InterruptedException {
UserEntity example = new UserEntity();
example.setName("嘎子");
example.setType((short) 1);
example.setCreatedAt(new Date());
userMapper.selectByExample(example);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testXXXX.
@Test
public void testXXXX() {
UserEntity entity = userMapper.selectByPrimaryKey(8);
userMapper.findMobileByIds(Arrays.asList(4, 5, 6));
userMapper.findByMobile(entity.getMobile());
userMapper.findByType((short) 1);
entity = userMapper.selectByPrimaryKey(8);
entity.setName(RandomStringUtils.random(5, true, true));
userMapper.updateByPrimaryKeySelective(entity);
userMapper.findMobileByIds(Arrays.asList(4, 5, 6));
userMapper.findByType((short) 1);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testUpdate.
@Test
public void testUpdate() throws InterruptedException {
UserEntity example = new UserEntity();
example.setStatus((short) 1);
example.setType((short) 1);
example.setName("嘎子");
example.setMobile("13800373090");
// userMapper.updateByExample(example);
//
// userMapper.updateType(1, new int[] {1,2,3});
//
// userMapper.updateByName("嘎子");
//
Map<String, Object> param = new HashMap<>();
param.put("status", example.getStatus());
param.put("type", example.getType());
param.put("name", example.getName());
param.put("mobile", example.getMobile());
// userMapper.updateByMap(param);
userMapper.updateTypeByExample(example.getType(), example);
Thread.sleep(60000);
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method testInsertSelective.
@Test
public void testInsertSelective() {
UserEntity entity = buildUserEntity();
userMapper.insertSelective(entity);
userMapper.deleteByPrimaryKey(entity.getId());
}
use of com.mendmix.mybatis.test.entity.UserEntity in project jeesuite-libs by vakinge.
the class BaseMybatisTest method buildUserEntity.
private UserEntity buildUserEntity() {
String mobile = "13800" + RandomStringUtils.random(6, false, true);
UserEntity entity = new UserEntity();
entity.setEmail(mobile + "@163.com");
entity.setMobile(mobile);
entity.setType((short) 1);
entity.setStatus((short) 1);
return entity;
}
Aggregations