jeecg随笔

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);

上一篇:jeecg自定义CriteriaQuery查询组装


下一篇:2019 CSP-J 游记(CQ LNBS考场 的退役之战)