调度分配(企业) __B3GppEOlMN18CvmGtfV __KWBHssgPtqkxvqhTKlW true 10 true false false false true relatedForm month normal false 0 __xSYBFHecAgmpL3druhw true public a.item_end_time "; } } if(isNotNull(bindedStatus)){ if(bindedStatus==0){//未绑定 whereStr+=" and a.item_binded_user_name = '' "; }else{ whereStr += " and a.item_binded_user_name != '' "; } } if(isNotNull(startTime)){ whereStr += "and a.item_end_time >= '"+format(startTime,"yyyy-MM-dd HH:mm:ss")+"' "; } if(isNotNull(endTime)){ whereStr += "and a.item_end_time <= '"+format(endTime,"yyyy-MM-dd HH:mm:ss")+"' "; } if(isNotNull(callerName)){ whereStr += "and a.item_binded_user_name like concat('%','"+callerName+"','%') "; } if(isNotNull(callerPhone)){ whereStr += "and item_binded_user_telephone like concat('%','"+callerPhone+"','%') "; } if(isNotNull(department)){ whereStr += "and item_binded_user_idnumber like concat('%','"+department+"','%') "; } if(isNotNull(number)){ whereStr += "and item_number like concat('%','"+number+"','%') "; } var sql = "select a.id,a.id as item_id,a.formid, "+ "'"+getDomainid()+"' as domainid,"+ "a.item_name,"+//产品名称 "a.item_number,"+//设备编号 "a.item_pk_id as item_device_pk_id,"+ "c.item_pk_id as item_device_desk_pk_id,"+ "a.item_product_pk_id,"+//产品id "a.item_device_no,"+//设备 "a.item_device_type,"+//设备类型 "a.item_binded_user_id,"+//绑定的用户id "a.item_binded_user_name,"+//绑定用户姓名 "a.item_binded_user_telephone,"+//绑定用户联系方式 "case when a.item_binded_user_name='' then '未绑定'else '已绑定' end as item_bind_status,"+//绑定状态 "a.item_binded_user_idnumber,"+//绑定用户身份证 "a.item_binded_user_attid,"+//绑定用户驻勤点id "b.ITEM_attendanceSiteName,"+//驻勤点姓名 "CASE WHEN now()>a.item_end_time THEN '已过期' ELSE '正常' END AS item_statuss,"+//账号状态 "a.item_product_category,"+//产品分类 // "group_concat(d.ITEM_ASSIGNED_DEPART_NAME) as item_service_scope ,"+//调度范围 "REPLACE(c.item_ip,';*','') as item_ip,"+//IP "a.item_DOMAIN_NAME,"+//企业名称 "a.item_end_time "+//到期时间 " from tlk_device a left join baibaodunflow.tlk_attendance_site_base_info b on b.id=a.item_binded_user_attid "+ " left join tlk_device_desk c on c.ITEM_DEVICEPKID=a.ITEM_PK_ID "+ " where a.item_product_category ='00003'and a.item_domain_id='"+getDomainid()+"' "; sql+=whereStr+" group by a.id order by a.item_end_time asc "; println(sql); return sql; })()]]> [] 1 02 0 0