1,079
社区成员
发帖
与我相关
我的任务
分享
em_begin.text = "1900-01-01"
em_end.text = string(today(),"yyyy-mm-dd")
string temp
declare cur_bm cursor for
select 部门名称 from 部门表;
ddlb_bm.additem("")
open cur_bm;
do while sqlca.sqlcode = 0
fetch cur_bm into :temp;
if sqlca.sqlcode = 0 then
ddlb_bm.additem(temp)
end if
loop
close cur_bm;
string ls_reselect
string ls_begin,ls_end
string ls_bh
string ls_xm
string ls_bm
string ls_xb
ls_begin = trim(em_begin.text) + " 00:00:00"
ls_end = trim(em_end.text) + " 23:59:59"
ls_bh = trim(sle_bh.text) //人员编号
ls_xm = trim(sle_xm.text) //姓名
ls_bm = trim(ddlb_bm.text) //部门
ls_xb = trim(ddlb_xb.text) //性别
/////////////
select 部门编号
into :ls_bm
from 部门表
where 部门名称 = :ls_bm;
//////////////////////////
ls_reselect = " 出生日期 >= ('" + ls_begin + "')" + " and 出生日期 <= ('" + ls_end + "')"
if ls_bh <> "" then
ls_reselect = ls_reselect + " and 职工编号 LIKE '%" + ls_bh + "%'"
end if
//
if ls_xm <> "" then
ls_reselect = ls_reselect + " and 职工姓名 LIKE '%" + ls_xm + "%'"
end if
//
if ls_bm <> "" then
ls_reselect = ls_reselect + " and 部门代码 LIKE '%" + ls_bm + "%'"
end if
//
if ls_xb <> "" then
ls_reselect = ls_reselect + " and 职工性别 LIKE '%" + ls_xb + "%'"
end if
closewithreturn(parent,ls_reselect)