<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()); }
时间: 2024-10-01 13:22:09