myBatisPlus的IPage分頁

KeyWord.xml

 <sql id="Key_Com_Column">
       SELECT
        BD_KEY_WORD.KEY_ID as keyId,
        KEY_WORD as keyWord,
        DESC_TYPE as descType,
        KEY_TYPE as keyType,
        BD_KEY_WORD.CREATE_TIME as createTime,
        APPLY_TIME as applyTime,
        BD_KEY_WORD.STATUS as status,
        KEY_CAUSE as keyCause,
        SF_COMPANY_INFO.COMPANY_NAME as comName
        FROM
        BD_KEY_WORD
        LEFT JOIN
        BD_KEY_COM
        ON BD_KEY_WORD.KEY_ID = BD_KEY_COM.KEY_ID
        LEFT JOIN
        SF_COMPANY_INFO
        ON BD_KEY_COM.COM_ID = SF_COMPANY_INFO.COM_ID
    </sql>
    
    
    <select id="sqlectKeyWordAndCom" resultType="com.geostar.bigdata.dto.KeyWordVo">
        <include refid="Key_Com_Column"/>
        WHERE 1 = 1
        <if test="comName != null and comName != ''">
            and SF_COMPANY_INFO.COMPANY_NAME like concat(concat('%', #{comName}), '%')
        </if>
        <if test="descType != null and descType != ''">
            and DESC_TYPE = #{descType}
        </if>
        <if test="keyType != null and keyType != ''">
            and KEY_TYPE = #{keyType}
        </if>
        <if test="status != null and status != ''">
            and BD_KEY_WORD.STATUS = #{status}
        </if>
    </select>

KeyWordMapper

    IPage<KeyWordVo> sqlectKeyWordAndCom(IPage<KeyWordVo> page,@Param("comName") String comName,@Param("descType")String descType,@Param("keyType") String keyType, @Param("status")String status);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章