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

  • 相关阅读:
    初识面向对象
    Git 子模块
    至今为止项目中遇到的问题
    vuex , 简单入(liao)门(jie)
    Git rebase
    Git
    js设计模式工厂模式
    vue slot
    Jquery学习,一道笔试题:关于表格【最近记】
    闭包与this学习
  • 原文地址:https://www.cnblogs.com/xujiating/p/10942859.html
Copyright © 2020-2023  润新知