这几天的项目总结
员工列表
第一个红框:岗位 至今没有写出来 认为是比较难的对我,(解决了其实很简单)
传的其实是一个字符串,用一个模糊查询就可以,我以为是数组
从数据库获取多个字段 在页面的第二个红框显示
代码
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); }