var acceptance_no = getItemValue("acceptance_no");
var industry = getItemValue("industry");
var return_type = "手工";
var value = buttonNewDoc("11e2-24c7-c3337f5e-808a-ed00cca46939", "手工回访", ["acceptance_no","industry","return_type"], [acceptance_no,industry,return_type],true);
value;
复制代码
视图过滤sql如下:
#include "actionlib";
println("testtttttttttttt");
var where = getWhereSQL(["_serial_no","_contact_tel","_datasource","_acceptance_time",
var fristvalue= getItemValueAsString("_return_result");
if (fristvalue!= null && isNotNull(fristvalue)) {
where +=" and firstc.item_return_result='"+fristvalue+"'";
}
var sql = " select (case when firstc.id is null then '未回访' when ( firstc.id is not null and firstc.id = lastc.id ) then '首次回访' else '最终回访' end ) item_size_acceptance ,"
+"firstc.item_return_result as item_first_return_result,lastc.item_return_result as item_last_return_result, firstc.item_is_acceptance,firstc.item_return_type,"
+" c.* from tlk_complaint c "
+" left join ("
+" select * from ("
+" select row_number()over( partition by item_acceptance_no order by r.created desc) as num ,r.* from tlk_complaints_return r"
+" ) t where num = 1"
+" ) lastc on c.item_acceptance_no= lastc.item_acceptance_no "
+" left join ("
+" select * from ("
+" select row_number()over( partition by item_acceptance_no order by r.created asc) as num ,r.* from tlk_complaints_return r"
+" ) t where num = 1"
+" ) firstc on c.item_acceptance_no= firstc.item_acceptance_no where c.item_acceptance_type='投诉' and c.stateLabel='办结' "+where