select * from t_table where id in (**,**,**);

------------>po
public class TWeekdetailToCreate
{

private List<String> ids;

private String userid;

private String projectName;

private String worktime;

private String extratime;

private String beginDate;

private String endDate;
}

---------------slqMap

<select id="getTWeekdetailToCreate" resultClass="TWeekdetailToCreate" parameterClass="TWeekdetailToCreate">
   select  b.projectName ,sum(a.WORKTIME) worktime,sum(a.EXTRATIME) extratime
from WORKLOAD.T_WORKDETAIL a left join WORKLOAD.T_PROJECT b on  a.PROJECTID = b.PROJECTID
where 1=1 and
<dynamic>
<isNotEmpty property="ids">
<iterate property="ids" prepend=" a.USERID in " open="(" close=")" conjunction=",">
#ids[]#
</iterate>
</isNotEmpty>
</dynamic>
and DATE &gt;= #beginDate# and DATE &lt;= #endDate#
group by b.projectName
    </select>




猜你喜欢

转载自qqm2m2002.iteye.com/blog/1015567