<?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>
|