mybais拼接% 模糊查询

<select id="queryWaitSignPageList" parameterType="com.bill.intemag.entity.BusBillWaitsign" resultType="com.bill.intemag.entity.BusBillWaitsign">
        SELECT
            A.*
        FROM
            BUS_BILL_WAITSIGN A
        JOIN (
            SELECT
                COMPNAME,
                FLAG,
                MAX(POIDATE) AS POIDATE
            FROM
                BUS_BILL_WARN
            GROUP BY
                COMPNAME,
                FLAG
        ) B ON A.ACPTRACCT_NAME = B.COMPNAME
        WHERE
            a.RECORDFLAG = 'A'
        AND a.CHECKFLAG IN ('0', '2')
        AND a.WARNFLAG = '1'
        AND a.DATAFLAG = '0'
        AND a.DATAOPERFLAG = '0'
        <if test="bw.billcode != null and bw.billcode !=''">
            AND a.billcode like '%${bw.billcode}%'
        </if>
    </select>

 

posted @ 2022-06-07 21:37  花田007  阅读(19)  评论(0编辑  收藏  举报