用script标签包围,然后像xml语法一样书写
@Select({"<script> " +
"select count(1) " +
"from operationscheduling os " +
"inner join operationanesthesia oa " +
"on os.operation_id = oa.operation_id " +
"where os.order_state = '已排班' and to_char(os.OPERATION_DATE, 'yyyy-MM-dd') = #{localDate} " +
"<if test = 'roomId != null and roomId != \"\" '> " +
"and os.room_id = #{roomId}" +
"</if>" +
"</script>"})
Integer getSurgeryExecCount(String localDate, String roomId);
网友评论