tuqin
2026-09-24 034f720f0bbc7f253c15613c28d994d7abf401eb
src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerMapper.xml
@@ -62,6 +62,24 @@
                AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d')
            </if>
        </where>
        ORDER BY update_time DESC
        ORDER BY create_time DESC
    </select>
    <select id="selectExistingCodes" resultType="java.lang.String">
        SELECT code
        FROM measuring_instrument_ledger
        WHERE tenant_id = #{tenantId}
        AND code IN
        <foreach collection="codes" item="code" open="(" separator="," close=")">
            #{code}
        </foreach>
    </select>
    <!-- 下拉选择:当前租户全部计量器具。SQL 带 /*data_scope*/ 标记,仅此查询豁免数据范围过滤 -->
    <select id="listOptions" resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger">
        SELECT /*data_scope*/ id, code, name, model, unit, most_date, valid, record_date
        FROM measuring_instrument_ledger
        WHERE tenant_id = #{tenantId}
        ORDER BY create_time DESC
    </select>
</mapper>