hrms

这几天的项目总结 

员工列表

第一个红框:岗位  至今没有写出来 认为是比较难的对我,(解决了其实很简单)

传的其实是一个字符串,用一个模糊查询就可以,我以为是数组 

从数据库获取多个字段 在页面的第二个红框显示 

代码

select GROUP_CONCAT(hdy.name separator'/')kind_text \n" +
        ",(select name from h_dictionary where h_dictionary.`value`=hsf.job and h_dictionary.parent_id=200)job_text\n" +
        ",(select name from h_dictionary where h_dictionary.`value`=hsf.work_type and h_dictionary.parent_id=300)type_text\n" +
        ",(select name from h_dictionary where h_dictionary.`value`=hsf.`status` and h_dictionary.parent_id=500)status_text\n" +
        ",(select name from h_dictionary where h_dictionary.`value`=hsf.`level` and h_dictionary.parent_id=400)level_text\n" +
        ",(select name from h_store where h_store.id=hsf.dept_id)store_name,hsf.*" ;

String sql = "from h_staff hsf LEFT JOIN h_dictionary hdy on FIND_IN_SET(hdy.`value`,hsf.kind) where 1=1

查看的时候遇到的一个debug 特别......................这两个文本框选择的时候

最开始写完的时候

添加下面的时候就好了

因为数据库建完表时如下所示  自动为0

而且最多只能输入五位数, 小数点后2位,小数点前5位,否则会报错,数组越界

修改的时候

显示页面的代码 kind 的处理,如果不写else判断 为空时 修改会把空格全选

if(!StringUtils.isEmpty(record.getStr("kind"))){

     String [] stringKind=record.getStr("kind").split(",");
     record.remove("kind");

    // List list= Arrays.asList(stringKind);
     record.set("kind",stringKind);
}
     else{
       //String [] stringKind=null;
       List<Record> list=new ArrayList<Record>();
         record.set("kind",list);
     }

修改的代码

// kind 的方式改变
String kind="";
 if(!StringUtils.isEmpty(staff.getStr("kind"))){
    String [] kinds=this.getParaValues("kind");

    for(int i=0;i<kinds.length;i++){
       //  kinds+=",";
         kind=kind+kinds[i]+",";
    }
     kind.substring(0,kind.length()-1 );
   staff.set("kind",kind);

}

 

转载于:https://my.oschina.net/u/3715015/blog/1924852

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值