<?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.warehouse.mapper.DocumentationMapper">
|
|
<select id="listPage" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
|
SELECT
|
doc.*,
|
dc.category,
|
CONCAT(
|
w.warehouse_name, '-',
|
wgs.name, '-',
|
wgsr.row, '层-',
|
wgsr.col, '列'
|
) AS location_info -- 合并后的字段名
|
FROM documentation doc
|
LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
|
LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
|
LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
|
LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
|
where 1=1
|
<if test="documentation.documentClassificationId != null">
|
and doc.document_classification_id = #{documentation.documentClassificationId}
|
</if>
|
<if test="documentation.docName != null">
|
and doc.doc_name = #{documentation.docName}
|
</if>
|
<if test="documentation.docNumber != null">
|
and doc.doc_number = #{documentation.docNumber}
|
</if>
|
<if test="documentation.id != null">
|
and doc.id = #{documentation.id}
|
</if>
|
</select>
|
<select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto">
|
SELECT
|
doc.*,
|
dc.category,
|
CONCAT(
|
w.warehouse_name, '-',
|
wgs.name, '-',
|
wgsr.row, '层-',
|
wgsr.col, '列'
|
) AS location_info -- 合并后的字段名
|
FROM documentation doc
|
LEFT JOIN document_classification dc ON doc.document_classification_id = dc.id
|
LEFT JOIN warehouse_goods_shelves_rowcol wgsr ON wgsr.id = doc.warehouse_goods_shelves_rowcol_id
|
LEFT JOIN warehouse_goods_shelves wgs ON wgs.id = wgsr.warehouse_goods_shelves_id
|
LEFT JOIN warehouse w ON w.id = wgs.warehouse_id
|
where doc.document_classification_id = #{documentClassificationId}
|
</select>
|
|
</mapper>
|