zoukankan      html  css  js  c++  java
  • SpringMvc的xml里关于<if>里传递多个参数(包含List、Integer、String)

    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>
  • 相关阅读:
    NET网络配置
    NTP时间同步器
    NFS配置linux
    DNS配置域名解析
    ftp配置windows
    samba配置与windows
    NTP服务和DNS服务
    NFS服务和DHCP服务scp
    SAMBA服务和FTP服务
    find用法
  • 原文地址:https://www.cnblogs.com/supiaopiao/p/12326011.html
Copyright © 2011-2022 走看看