select * from ("+
" select ROWNUM AS RN, t.* from("+
"select distinct *\n" +
" from t_ows_flow_instance t1\n" +
" inner join t_ows_license_flow_data t2\n" +
" on t1.id = t2.instance_id\n" +
" where 1=1 " +
" <if test='params.status == \"0\"'>\n" +
"and (t1.node_name = '提交申请' or t1.node_name = '代表处产品经理审批' or t1.node_name = '代表处解决方案销售部长审批' or t1.node_name = '代表处企业交付与服务部长')\n" +
"</if> " +
" <if test='params.status == \"1\"'>\n" +
"and (t1.node_name='提醒客户' or t1.node_name='提交预警函' or t1.node_name='确认收编' or t1.node_name='下载License'" +
"or t1.node_name='下载临时License' or t1.node_name='收编' or t1.node_name='收编环节' or t1.node_name='确认提交风险预警' )\n" +
"</if> " +
" <if test='params.status == \"2\"'>\n" +
"and t1.node_name='结束'\n" +
"</if> " +
"<if test=\"params.DBCHUYE != null and params.DBCHUYE !='' \">\n" +
"and t2.DBCHUYE like concat(concat('%',#{params.DBCHUYE}),'%')"+
"</if>"+
"<if test=\"params.search != null and params.search !='' \">\n" +
"and (" +
" <foreach collection=\"params.list\" item=\"code\">\n" +
" ${code} like concat(concat('%',#{params.search}),'%') or \n" +
" </foreach> 1=2)" +
"</if>) t)" +
" where RN > #{params.startRow} and RN <![CDATA[ <= ]]> #{params.endStartRow}\n" +
" order by rn