select 须填写项.*,月度汇总.出勤天数,月度汇总.事假,月度汇总.病假,月度汇总.迟到次数,CAST(月度汇总.迟到时长 AS UNSIGNED) from 须填写项,月度汇总 where 须填写项.姓名 = 月度汇总.姓名 and 须填写项.月份 = 月度汇总.月份 ${if(len(month) == 0,"","and 须填写项.月份 = '" + month + "'")} ${if(len(let) == 0,"","and 须填写项.部门 = '" + department + "'")} ${if(len(let2) == 0,"","and 须填写项.是否交纳社保 = '" + security + "'")} ${if(len(let3) == 0,"","and 须填写项.姓名 = '" + name + "'")} ${if(len(let4) == 0,"","and 须填写项.分公司 = '" + branch + "'")} 我写的这个能够查询到每个月每个人的一个情况,但是我现在还想查询到个人整年的一个情况,需要怎么改? 这是须填写项的,我没有设置主键 |