jeecg随笔

1.根据数据字典code查找该字典下的元素:

SELECT typecode,typename from t_s_type where typegroupid=(select id from t_s_typegroup where typegroupcode='fchexing')

fchexing为字典的code

2.jdbcTemplate,jeecgMinidaoDao类的引入

@Resource
private JdbcTemplate jdbcTemplate;

@Autowired
private JeecgMinidaoDao jeecgMinidaoDao;

3.获取当前登录用户的实体类

TSUser user = ResourceUtil.getSessionUserName();//老版本

TSUser user = ResourceUtil.getSessionUser();//新版本

List<TSRoleUser> rUsers1 = systemService.findByProperty(TSRoleUser.class, "TSUser.id", user.getId());//获取用户的角色

String departcode=jdbcTemplate.queryForObject("select org_code from t_s_depart where id=?", String.class,user.getDepartid());//获取用户的部门

猜你喜欢

转载自www.cnblogs.com/xujiating/p/10942859.html