mybatis 之parameterType="Long"
阿新 • • 發佈:2017-08-03
mode ctr ble parameter div except size base each
<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"