码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis 之parameterType="Long"

时间:2017-08-03 14:00:12      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:pre   sys   int   jdbc   item   ice   print   param   type   

    <select id="selectByPrimaryKeyByArrayMemberId"  resultType="memberModel" parameterType="Long">
           select 
           <include refid="Base_Column_List"/>
              from member m
           where
           m.IS_DELETE = N
           and m.member_id IN
           <foreach item="item" index="index" collection="list" open="(" separator="," close=")">  
             #{item,jdbcType=DECIMAL}  
        </foreach>
    </select>
public ServiceMessage<List<Member>> selectByPrimaryKeyByArrayMemberId(
            List<Long> memberIds)
    {
        try
        {
            if (memberIds == null || memberIds.size()==0){
                return super.returnParamsError("参数为空!");
            }
            List<Member> list = memberMapper
            .selectByPrimaryKeyByArrayMemberId(memberIds);
            return super.returnCorrectResult(list);
        }
        catch (Throwable e)
        {
            return super.returnException(e);
        }
    }
    public ServiceMessage<List<Member>> selectByPrimaryKeyByArrayMemberId(List<Long> memberIds);
    List<Member> selectByPrimaryKeyByArrayMemberId(List<Long> memberIds);
    @Test
    public void testSelectByPrimaryKeyByArrayMemberId()
    {
        InternalMemberService internalMemberService = J1SOAHessianHelper.getService(url,InternalMemberService.class);
        List<Long> memberIds = new ArrayList<Long>();
        memberIds.add(1l);
        memberIds.add(2l);
        memberIds.add(1855l);
        ServiceMessage<List<Member>> sm = internalMemberService.selectByPrimaryKeyByArrayMemberId(memberIds);
        System.out.println(sm.getResult());
    }

 

mybatis 之parameterType="Long"

标签:pre   sys   int   jdbc   item   ice   print   param   type   

原文地址:http://www.cnblogs.com/wangchuanfu/p/7278949.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!