zss
3 天以前 3effe2402062b93d9ea0ea3fed340156f2be937b
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -15,14 +15,18 @@
        next_date,
        record_date,
        CASE
        WHEN next_date >=  DATE_FORMAT(now(),'%Y-%m-%d') THEN 1
        WHEN most_date >=  DATE_FORMAT(now(),'%Y-%m-%d') THEN 1
        ELSE 2
        END AS status,
        create_user,
        create_time,
        update_user,
        update_time,
        tenant_id
        tenant_id,
        unit,
        dept_id,
        instation_location,
        cycle
        FROM
        measuring_instrument_ledger
        <where>
@@ -36,10 +40,10 @@
            <if test="req.status != null">
                <choose>
                    <when test="req.status == 1">
                        AND next_date &gt;=  DATE_FORMAT(now(),'%Y-%m-%d')
                        AND most_date &gt;=  DATE_FORMAT(now(),'%Y-%m-%d')
                    </when>
                    <when test="req.status == 2">
                        AND next_date &lt;  DATE_FORMAT(now(),'%Y-%m-%d')
                        AND most_date &lt;  DATE_FORMAT(now(),'%Y-%m-%d')
                    </when>
                </choose>
            </if>
@@ -52,4 +56,4 @@
        </where>
        ORDER BY update_time DESC
    </select>
</mapper>
</mapper>