jeecg随笔

核能气质少年 提交于 2019-12-09 17:24:08

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

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

fchexing为字典的code

<t:dictSelect field="transMode"   typeGroupCode="orderCj"  extendJson="{onchange:'fun_tel()'}"  title="成交方式" ></t:dictSelect>

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());//获取用户的部门

4.获取select,select2的值并赋值

 var   crProteacty=$("select[name='crProteacty']").val();  //select的值


var crFromCarno=$("#crFromCarno").val();//select2的值

$("select[name='crFujian']").val(crProteacty);  //select赋值

$("#crInno").val(crFromCarno).trigger('change'); //select2赋值

$("#select2-crFromCarno-container").text(crBoxSealno);

5.cq加入不为空

cq.add(Restrictions.sqlRestriction(" bill_Orderno !='' and bill_Orderno is not null"));

6.获取根目录

request.getRealPath("/")

7.复制方法

MyBeanUtils.copyBeanNotNull2Bean(ldCooMapping, t);

8.cq的in方法

List<String> sss = new ArrayList<String>();
sss.add("1");
String[] strings = new String[sss.size()];
cq.in("bpmStatus", sss.toArray(strings));

9.hql查询

String hql = "from EnterGoodsEntity where 1 = 1 AND delegateId = ? and delFlag=0 ";
List<EnterGoodsEntity> enterGoodsEntityList = systemService.findHql(hql,id);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!