Cui Zhi Feng
2024-10-25 4f0dd4e3ebabcfc1ea71550c27b19b7dea1b2a95
src/main/resources/mapper/wallet/WalletBillRecordMapper.xml
@@ -38,7 +38,7 @@
    </select>
    <select id="queryPage" resultType="com.mzl.flower.dto.response.wallet.WalletBillRecordVO">
        select t.* ,s.name supplierName from t_wallet_bill_record t
        select t.* ,s.name supplierName ,w.approve_time as approveTime  from t_wallet_bill_record t
        left join t_supplier_info s on t.supplier_id = s.id
        left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
        where t.deleted= 0
@@ -49,37 +49,28 @@
            and t.supplier_id = #{dto.supplierId}
        </if>
        <if test="dto.type != null and dto.type != ''">
            and t.type = #{type}
            and t.type = #{dto.type}
        </if>
        <if test="dto.orderNo != null and dto.orderNo != ''">
            and torder_no = like concat('%', #{orderNo}, '%')
            and t.order_no  like concat('%', #{dto.orderNo}, '%')
        </if>
        <if test="dto.createStartDate!=null ">
            <![CDATA[.
               AND w.create_time &gt;= #{dto.createStartDate}
            ]]>
            AND DATE_FORMAT(w.create_time, '%Y-%m-%d') &gt;= #{dto.createStartDate}
        </if>
        <if test="dto.endEndDate!=null ">
            <![CDATA[
               AND w.create_time &lt;= #{dto.endEndDate}
            ]]>
            AND DATE_FORMAT(w.create_time, '%Y-%m-%d') &lt;= #{dto.endEndDate}
        </if>
        <if test="dto.approveStartDate!=null ">
            <![CDATA[
               AND w.approve_time &gt;= #{dto.approveStartDate}
            ]]>
            AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') &gt;= #{dto.approveStartDate}
        </if>
        <if test="dto.approveEndDate!=null ">
            <![CDATA[
               AND w.approve_time &lt;= #{dto.approveStartDate}
            ]]>
            AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') &lt;= #{dto.approveEndDate}
        </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
        select t.* , s.name supplierName, w.approve_time as approveTime from t_wallet_bill_record t
        left join t_supplier_info s on t.supplier_id = s.id
        left join t_wallet_withdraw_record w on t.withdraw_record_id = w.id
        where t.deleted= 0
@@ -90,32 +81,23 @@
            and t.supplier_id = #{dto.supplierId}
        </if>
        <if test="dto.type != null and dto.type != ''">
            and t.type = #{type}
            and t.type = #{dto.type}
        </if>
        <if test="dto.orderNo != null and dto.orderNo != ''">
            and t.order_no = like concat('%', #{orderNo}, '%')
            and t.order_no  like concat('%', #{dto.orderNo}, '%')
        </if>
        <if test="dto.createStartDate!=null ">
            <![CDATA[
               AND w.create_time &gt;= #{dto.createStartDate}
            ]]>
            AND DATE_FORMAT(w.create_time, '%Y-%m-%d') &gt;= #{dto.createStartDate}
        </if>
        <if test="dto.endEndDate!=null ">
            <![CDATA[
               AND w.create_time &lt;= #{dto.endEndDate}
            ]]>
            AND DATE_FORMAT(w.create_time, '%Y-%m-%d') &lt;= #{dto.endEndDate}
        </if>
        <if test="dto.approveStartDate!=null ">
            <![CDATA[
               AND w.approve_time &gt;= #{dto.approveStartDate}
            ]]>
            AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') &gt;= #{dto.approveStartDate}
        </if>
        <if test="dto.approveEndDate!=null ">
            <![CDATA[
               AND w.approve_time &lt;= #{dto.approveStartDate}
            ]]>
            AND DATE_FORMAT(w.approve_time, '%Y-%m-%d') &lt;= #{dto.approveEndDate}
        </if>
        order by t.create_time
    </select>
</mapper>