From 8238b458d6a3bec147fd4b639ed0427de7cf8be4 Mon Sep 17 00:00:00 2001 From: yaowanxin <3588231647@qq.com> Date: 星期一, 11 八月 2025 15:27:41 +0800 Subject: [PATCH] 添加附件 --- src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml new file mode 100644 index 0000000..69446e0 --- /dev/null +++ b/src/main/resources/mapper/measuringinstrumentledger/MeasuringInstrumentLedgerRecordMapper.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.measuringinstrumentledger.mapper.MeasuringInstrumentLedgerRecordMapper"> + + <select id="listPage" + resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord"> + SELECT + t1.id, + t1.user_id, + t1.user_name, + t2.code, + t2.name, + t2.model, + t1.valid, + t1.record_date, + t1.entry_date + FROM + measuring_instrument_ledger_record t1 + left join measuring_instrument_ledger t2 on t1.measuring_instrument_ledger_id = t2.id + <where> + <!-- 鏌ヨ鏉′欢鍚屼笂 --> + <if test="req.code != null and req.code != ''"> + AND t2.code LIKE CONCAT('%', #{req.code}, '%') + </if> + <if test="req.name != null and req.name != ''"> + AND t2.name LIKE CONCAT('%', #{req.name}, '%') + </if> + <if test="req.entryDate != null"> + AND t1.entry_date = DATE_FORMAT(#{req.entryDate},'%Y-%m-%d') + </if> + <if test="req.recordDate != null"> + AND t1.record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d') + </if> + </where> + ORDER BY t1.update_time DESC + </select> + <select id="list" resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord"> + SELECT + t1.id, + t1.user_id, + t1.user_name, + t2.code, + t2.name, + t2.model, + t1.valid, + t1.record_date, + t1.entry_date + FROM + measuring_instrument_ledger_record t1 + left join measuring_instrument_ledger t2 on t1.measuring_instrument_ledger_id = t2.id + <where> + <!-- 鏌ヨ鏉′欢鍚屼笂 --> + <if test="req.code != null and req.code != ''"> + AND t2.code LIKE CONCAT('%', #{req.code}, '%') + </if> + <if test="req.name != null and req.name != ''"> + AND t2.name LIKE CONCAT('%', #{req.name}, '%') + </if> + <if test="req.entryDate != null"> + AND t1.entry_date = DATE_FORMAT(#{req.entryDate},'%Y-%m-%d') + </if> + <if test="req.recordDate != null"> + AND t1.record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d') + </if> + </where> + ORDER BY t1.update_time DESC + </select> +</mapper> \ No newline at end of file -- Gitblit v1.9.3