123213213

selectSql.append("select CardNo,HolderName,IoDate,min(format(IoTime,'hh:mm:ss')) as StartWorkDate,max(format(IoTime,'hh:mm:ss')) as EndtWorkDate,min(DepartmentNo) as DeptNo from IOData ");
selectSql.append("where (format(IoDate,'yyyy-mm-dd') between format('"+startDate+"','yyyy-mm-dd') and format('"+startDate+"','yyyy-mm-dd') and format(IoTime,'hh:mm:ss') between format('04:00:00','hh:mm:ss') and format('23:59:59','hh:mm:ss')) ");
selectSql.append("or (format(IoDate,'yyyy-mm-dd') between format('"+endDate+"','yyyy-mm-dd') and format('"+endDate+"','yyyy-mm-dd') and format(IoTime,'hh:mm:ss') between format('00:00:00','hh:mm:ss') and format('03:59:59','hh:mm:ss')) ");
selectSql.append("and DepartmentNo not in('0000','06','08','09','10','11','13') and HolderName not like '%临时卡' ");
selectSql.append("group by IoDate,HolderName,CardNo order by HolderName,IoDate");

猜你喜欢

转载自soya520.iteye.com/blog/1924484