自定义返回值
import java.util.List;
import java.util.Map;
import com.ailk.aiip.cms.model.AuthenticationCount;
public interface AuthenticationCountMapper {
List<AuthenticationCount> findAuthenticationCounts(Map<String, Object> menuParam);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ailk.aiip.cms.dao.AuthenticationCountMapper">
<resultMap id="autt" type="com.ailk.aiip.cms.model.AuthenticationCount">
<result column="mobilephone" property="mobilePhone" />
<result column="company" property="company" />
<result column="group_id" property="groupId" />
<result column="group_name" property="groupName" />
<result column="creater" property="creater" />
<result column="createtime" property="createTime" />
<result column="bak" property="bak" />
<result column="count" property="count" />
</resultMap>
<select id="findAuthenticationCounts" resultMap="autt" parameterType="java.util.HashMap">
<![CDATA[
select * from (
select wt.*,tp.count from ( select w.mobilephone mobilephone,count(t.user_name) count from whitelist w,access_log_20150701 t
where t.user_name like '%'||w.mobilephone||'%'
and t.bms_return_reason is null
group by w.mobilephone order by w.mobilephone ) tp,whitelist wt where tp.mobilephone=wt.mobilephone
) v where v.count> ${count}
and v.group_name like '%${groupName}%' and v.company like '%${company}%'
]]>
</select>
</mapper>