You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.8 KiB
64 lines
2.8 KiB
<?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="org.springblade.modules.material.mapper.MaterialMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="materialResultMap" type="org.springblade.modules.material.pojo.entity.MaterialEntity">
|
|
<result column="id" property="id"/>
|
|
<result column="company_id" property="companyId"/>
|
|
<result column="code" property="code"/>
|
|
<result column="name" property="name"/>
|
|
<result column="type" property="type"/>
|
|
<result column="model" property="model"/>
|
|
<result column="power" property="power"/>
|
|
<result column="retail_price" property="retailPrice"/>
|
|
<result column="description" property="description"/>
|
|
<result column="brand" property="brand"/>
|
|
<result column="stock" property="stock"/>
|
|
<result column="unit" property="unit"/>
|
|
<result column="create_user" property="createUser"/>
|
|
<result column="create_dept" property="createDept"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="update_user" property="updateUser"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="status" property="status"/>
|
|
<result column="is_deleted" property="isDeleted"/>
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectMaterialPage" resultMap="materialResultMap">
|
|
select * from sf_material where is_deleted = 0
|
|
</select>
|
|
|
|
|
|
<select id="exportMaterial" resultMap="materialResultMap">
|
|
SELECT * FROM sf_material ${ew.customSqlSegment}
|
|
</select>
|
|
|
|
<select id="getMaterialById" resultType="org.springblade.modules.material.pojo.dto.MaterialDTO">
|
|
select m.*,d.dict_value AS materialType
|
|
from sf_material m
|
|
LEFT JOIN blade_dict d ON d.code = 'wl_type' AND d.parent_id > 0 AND d.is_sealed = 0 AND d.is_deleted = 0 AND d.dict_key=m.type
|
|
where m.id=#{materialId}
|
|
</select>
|
|
|
|
|
|
<select id="getMaterialDetailByCode" resultType="org.springblade.modules.material.pojo.dto.MaterialDTO">
|
|
select m.*,d.dict_value AS materialType
|
|
from sf_material m
|
|
LEFT JOIN blade_dict d ON d.code = 'wl_type' AND d.parent_id > 0 AND d.is_sealed = 0 AND d.is_deleted = 0 AND d.dict_key=m.type
|
|
where m.code=#{materialCode}
|
|
</select>
|
|
|
|
<select id="getOrderListByNumber" resultType="org.springblade.modules.order.pojo.vo.SelectVo">
|
|
SELECT o.id,o.number FROM `sf_operation_order` o
|
|
WHERE o.status NOT IN('6','7')
|
|
<if test="number !=null and number !='' ">
|
|
AND o.number LIKE concat('%',#{number},'%')
|
|
</if>
|
|
<if test="siteId !=null and siteId !='' ">
|
|
AND o.site_id=#{siteId}
|
|
</if>
|
|
</select>
|
|
</mapper>
|