cloudroam
2024-10-28 f77c25900aac7231d006d8f4e08aaa12d72c62b4
src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
@@ -15,9 +15,94 @@
        <result column="type" property="type" />
        <result column="type_detail" property="typeDetail" />
        <result column="transfer_id" property="transferId" />
        <result column="method" property="method" />
        <result column="original_amount" property="originalAmount" />
        <result column="change_amount" property="changeAmount" />
        <result column="balance" property="balance" />
        <result column="transfer_detail_id" property="transferDetailId" />
        <result column="open_id" property="openId" />
    </resultMap>
    <select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
        select t.* ,s.name supplierName from t_wallet_bill_record t
        left join t_supplier_info s on t.supplier_id = s.id
        left join t_order o on t.order_id = o.id
        left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
        where t.deleted= 0
        <if test="dto.supplierName != null and dto.supplierName != ''">
            and s.name like concat('%', #{dto.supplierName}, '%')
        </if>
        <if test="dto.supplierId != null and dto.supplierId != ''">
            and t.supplier_id = #{dto.supplierId}
        </if>
        <if test="dto.type != null and dto.type != ''">
            and t.type = #{type}
        </if>
        <if test="dto.orderNo != null and dto.orderNo != ''">
            and o.order_no = like concat('%', #{orderNo}, '%')
        </if>
        <if test="dto.createStartDate!=null ">
            <![CDATA[
               AND w.create_time &gt;= #{dto.createStartDate}
            ]]>
        </if>
        <if test="dto.endEndDate!=null ">
            <![CDATA[
               AND w.create_time &lt;= #{dto.endEndDate}
            ]]>
        </if>
        <if test="dto.approveStartDate!=null ">
            <![CDATA[
               AND w.approve_time &gt;= #{dto.approveStartDate}
            ]]>
        </if>
        <if test="dto.approveEndDate!=null ">
            <![CDATA[
               AND w.approve_time &lt;= #{dto.approveStartDate}
            ]]>
        </if>
        order by t.create_time
    </select>
    <select id="queryWalletBillRecordList" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
        select t.* ,s.name supplierName from t_wallet_bill_record t
        left join t_supplier_info s on t.supplier_id = s.id
        left join t_order o on t.order_id = o.id
        left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
        where t.deleted= 0
        <if test="dto.supplierName != null and dto.supplierName != ''">
            and s.name like concat('%', #{dto.supplierName}, '%')
        </if>
        <if test="dto.supplierId != null and dto.supplierId != ''">
            and t.supplier_id = #{dto.supplierId}
        </if>
        <if test="dto.type != null and dto.type != ''">
            and t.type = #{type}
        </if>
        <if test="dto.orderNo != null and dto.orderNo != ''">
            and o.order_no = like concat('%', #{orderNo}, '%')
        </if>
        <if test="dto.createStartDate!=null ">
            <![CDATA[
               AND w.create_time &gt;= #{dto.createStartDate}
            ]]>
        </if>
        <if test="dto.endEndDate!=null ">
            <![CDATA[
               AND w.create_time &lt;= #{dto.endEndDate}
            ]]>
        </if>
        <if test="dto.approveStartDate!=null ">
            <![CDATA[
               AND w.approve_time &gt;= #{dto.approveStartDate}
            ]]>
        </if>
        <if test="dto.approveEndDate!=null ">
            <![CDATA[
               AND w.approve_time &lt;= #{dto.approveStartDate}
            ]]>
        </if>
        order by t.create_time
    </select>
</mapper>