package com.etc.dao;
import com.etc.entity.User;
import com.etc.entity.UserExample;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.io.IOException;
import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class UserDAOTest {
@Autowired
private UserMapper userMapper;
@Test
public void test() throws IOException {
//通过criteria构造查询条件
UserExample userExample = new UserExample();
userExample.setOrderByClause("u_name asc"); //asc升序,desc降序排列<