dao层:
List<ProjectCompanyOrg> findProCompanyListByOrgIds(@Param("orgIdList") List<Integer> orgIdList, @Param("orgName") String orgName, @Param("projectId") Integer projectId);
xml层:
<select id="findProCompanyOrgListByOrgIds" resultType="com.highgoal.group.project.domain.entity.ProjectCompanyOrg"> select a.id as aid,a.org_id , b.* from project_company_org_unti a join project_company_org b on a.project_company_org_id = b.project_company_org_id <where> a.del = 0 and b.del = 0 <if test="orgIdList.size()!=0"> and a.org_id in <foreach collection="orgIdList" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> <if test="orgName != null and orgName != ''"> and b.org_name like concat('%',concat(#{orgName},'%')) </if> <if test="projectId != null"> and b.project_id = #{projectId,jdbcType=INTEGER} </if> </where> </select>