<!-- 根据条件查询资产信息 -->
    <select id="getAssetCommonByPage" resultType="java.util.Map">
        SELECT 
        *,t2.name as category_name,t3.name as type_name
        FROM 
        s_it_asset_common t1
        LEFT JOIN 
        s_asset_category t2 
        ON 
        t1.category = t2.id 
        LEFT JOIN
        s_asset_type t3 
        ON 
        t1.type = t3.id
        WHERE 1=1
        <if test="id !='' and id != null">
            AND
            id=#{id,jdbcType=NUMERIC}
        </if>
        <if test="code !='' and code != null">
            AND
            code=#{code}
        </if>
        <if test="category !='' and category != null">
            AND
            category=#{category}
        </if>
        <if test="type !='' and type != null">
            AND
            type=#{type}
        </if>
        <if test="mfr !='' and mfr != null">
            AND
            mfr like CONCAT('%',#{mfr},'%')
        </if>
        <if test="ip !='' and ip != null">
            AND
            ip=#{ip}
        </if>
        <if test="name !='' and name != null">
            AND
            name like CONCAT('%',#{name},'%')
        </if>
        <if test="currPage != null and currPage != '' and pageSize != null and pageSize != ''">
            limit ${currPage - 1}, ${pageSize}
        </if>
    </select>

 

相关文章:

  • 2021-05-20
  • 2021-09-09
  • 2021-05-16
  • 2021-04-18
  • 2021-07-15
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-09
  • 2021-11-20
  • 2022-02-17
  • 2022-12-23
  • 2022-02-09
  • 2021-12-26
相关资源
相似解决方案