5 天以前 d17d4d1ac98865d2a71b4f24771b7b76e0839ed3
src/main/resources/mapper/device/DeviceLedgerMapper.xml
@@ -10,9 +10,11 @@
        dl.id,
        dl.device_name,
        dl.device_model,
        dl.supplier_name,
        dl.device_brand,
        dl.storage_location,
            dl.area_id,
            da.area_name,
            dl.supplier_name,
        dl.unit,
        dl.number,
        dl.status,
@@ -33,60 +35,56 @@
        dl.annual_depreciation_amount,
        dl.type
        FROM device_ledger dl
        left join sys_user su on dl.create_user = su.user_id
                 LEFT JOIN sys_user su ON dl.create_user = su.user_id
                 LEFT JOIN device_area da ON dl.area_id = da.id
        <where>
            <!-- 设备名称 -->
            <if test="deviceLedger.deviceName != null and deviceLedger.deviceName != ''">
                AND device_name LIKE CONCAT('%', #{deviceLedger.deviceName}, '%')
                AND dl.device_name LIKE CONCAT('%', #{deviceLedger.deviceName}, '%')
            </if>
            <!-- 规格型号 -->
            <if test="deviceLedger.deviceModel != null and deviceLedger.deviceModel != ''">
                AND device_model LIKE CONCAT('%', #{deviceLedger.deviceModel}, '%')
                AND dl.device_model LIKE CONCAT('%', #{deviceLedger.deviceModel}, '%')
            </if>
            <!-- 供应商名称 -->
            <if test="deviceLedger.supplierName != null and deviceLedger.supplierName != ''">
                AND supplier_name LIKE CONCAT('%', #{deviceLedger.supplierName}, '%')
                AND dl.supplier_name LIKE CONCAT('%', #{deviceLedger.supplierName}, '%')
            </if>
            <!-- 单位 -->
            <if test="deviceLedger.areaId != null">
                AND dl.area_id = #{deviceLedger.areaId}
            </if>
            <if test="deviceLedger.areaName != null and deviceLedger.areaName != ''">
                AND da.area_name LIKE CONCAT('%', #{deviceLedger.areaName}, '%')
            </if>
            <if test="deviceLedger.unit != null and deviceLedger.unit != ''">
                AND unit = #{deviceLedger.unit}
                AND dl.unit = #{deviceLedger.unit}
            </if>
            <!-- 录入人 -->
            <if test="deviceLedger.createUser != null and deviceLedger.createUser != ''">
                AND create_user LIKE CONCAT('%', #{deviceLedger.createUser}, '%')
                AND dl.create_user LIKE CONCAT('%', #{deviceLedger.createUser}, '%')
            </if>
            <!-- 更新人 -->
            <if test="deviceLedger.updateUser != null and deviceLedger.updateUser != ''">
                AND update_user LIKE CONCAT('%', #{deviceLedger.updateUser}, '%')
                AND dl.update_user LIKE CONCAT('%', #{deviceLedger.updateUser}, '%')
            </if>
            <if test="deviceLedger.entryDateStart != null and deviceLedger.entryDateStart != '' ">
                AND dl.create_time &gt;= DATE_FORMAT(#{deviceLedger.entryDateStart},'%Y-%m-%d')
            </if>
            <if test="deviceLedger.entryDateEnd != null and deviceLedger.entryDateEnd != '' ">
                AND dl.create_time &lt;= DATE_FORMAT(#{deviceLedger.entryDateEnd},'%Y-%m-%d')
            </if>
            <!-- 租户ID -->
            <if test="deviceLedger.tenantId != null">
                AND tenant_id = #{deviceLedger.tenantId}
                AND dl.tenant_id = #{deviceLedger.tenantId}
            </if>
        </where>
        ORDER BY create_time DESC
        ORDER BY dl.create_time DESC
    </select>
    <select id="deviceLedgerExportList" resultType="com.ruoyi.device.execl.DeviceLedgerExeclDto">
    </select>
    <select id="selectById1" resultType="com.ruoyi.device.pojo.DeviceLedger">
        select *
        from device_ledger
        where id = #{id}
    </select>
    <select id="getDeviceTypeDistributionByYear"
            resultType="com.ruoyi.account.dto.DeviceTypeDetail"
            parameterType="java.lang.Integer">
@@ -99,6 +97,5 @@
          AND type IS NOT NULL
        GROUP BY type
    </select>
</mapper>