<?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.production.mapper.ProductMaterialSkuMapper">
|
|
<resultMap id="ProductMaterialSkuResultMap" type="com.ruoyi.production.pojo.ProductMaterialSku">
|
<id property="id" column="id"/>
|
<result property="productId" column="product_id"/>
|
<result property="identifierCode" column="identifier_code"/>
|
<result property="materialCode" column="material_code"/>
|
<result property="model" column="model"/>
|
<result property="supplyType" column="supply_type"/>
|
<result property="originatorName" column="originator_name"/>
|
<result property="originatorOrg" column="originator_org"/>
|
<result property="formInstanceId" column="form_instance_id"/>
|
<result property="formModifiedTime" column="form_modified_time"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
|
<select id="selectSkuWithMaterialPage" resultType="com.ruoyi.production.dto.ProductMaterialSkuDto">
|
SELECT
|
sku.id AS id,
|
sku.product_id AS productId,
|
sku.material_code AS materialCode,
|
sku.model AS model,
|
sku.supply_type AS supplyType,
|
m.product_name AS productName,
|
m.unit AS unit
|
FROM product_material_sku sku
|
LEFT JOIN product_material m ON sku.product_id = m.id
|
<where>
|
<if test="dto.productId != null">
|
AND sku.product_id = #{dto.productId}
|
</if>
|
<if test="dto.model != null and dto.model != ''">
|
AND sku.model LIKE CONCAT('%', #{dto.model}, '%')
|
</if>
|
<if test="dto.materialCode != null and dto.materialCode != ''">
|
AND sku.material_code LIKE CONCAT('%', #{dto.materialCode}, '%')
|
</if>
|
|
<if test="type != null and type == 1 and dto.productName != null and dto.productName != ''">
|
AND m.product_name LIKE CONCAT('%', #{dto.productName}, '%')
|
</if>
|
</where>
|
ORDER BY sku.id ASC
|
</select>
|
|
</mapper>
|