|
|
<?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.spring.modules.part.mapper.PartInformationMapper">
<!-- 材料信息列表 --> <select id="partInformationSearch" parameterType="com.spring.modules.part.vo.PartInformationVo" resultType="com.spring.modules.part.vo.PartInformationVo"> SELECT site, part_no, part_desc, spec, part_type_db, part_type, family_id, dbo.get_family_name(site, family_id) as familyName, group_id, dbo.get_group_name(site, group_id) as groupName, umid, active, supplier_id, dbo.get_supplier_name(site, supplier_id) as supplierName, other_group1, other_group2, other_group3, other_group4, erp_part_no, code_no, manufacturer_id, dbo.get_manufacturer_name(site, supplier_id) as manufacturerName, create_date, create_by, update_date, update_by FROM part <where> site = #{query.site} <if test = "query.partNo != null and query.partNo != ''"> AND part_no like #{query.partNo} </if> <if test = "query.erpPartNo != null and query.erpPartNo != ''"> AND erp_part_no like #{query.erpPartNo} </if> <if test = "query.partDesc != null and query.partDesc != ''"> AND part_desc like #{query.partDesc} </if> <if test = "query.spec != null and query.spec != ''"> AND spec like #{query.spec} </if> <if test="query.startDate != null "> AND required_completion_date >= #{query.startDate} </if> <if test="query.endDate != null "> AND #{query.endDate} >= required_completion_date </if> </where> </select>
<!-- 获取材料编码 --> <select id="getPartNo" resultType="string" parameterType="PartInformationEntity"> SELECT Right('0000000000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(part_no, 3, 10))), 0) + 1), 8) FROM part WHERE site = #{site} </select>
<!--按照orderRef1查询文件文件参数--> <select id="getFileContentList" resultType="SysOssEntity" parameterType="SysOssEntity"> SELECT id, url, create_date, file_name, new_file_name, create_by, order_ref1, order_ref2, order_ref3, file_type, file_suffix, file_type_code, file_remark FROM sys_oss <where> <if test="orderRef1 != '' and orderRef1 != null "> and order_ref1 = #{orderRef1} </if> <if test="orderRef2 != '' and orderRef2 != null "> and order_ref2 = #{orderRef2} </if> <if test="orderRef3 != '' and orderRef3 != null "> and order_ref3 = #{orderRef3} </if> </where> </select>
<!-- 获得报价单号 --> <select id="getQuotationNo" resultType="string" parameterType="QuotationInformationEntity"> SELECT Right('0000000000' + convert(VARCHAR(10), isnull(max(convert(INT, SUBSTRING(quotation_no, 3, 10))), 0) + 1), 8) FROM plm_quotation_information WHERE site = #{site} </select>
<!-- 批量删除文件--> <delete id="batchDeleteQuotationFile" parameterType="com.spring.modules.quotation.vo.SysOssVo"> DELETE FROM sys_oss <where> order_ref1 = #{orderRef1} and order_ref2 = #{orderRef2} <if test = "fileName != null and fileName != ''"> AND file_name = #{fileName} </if> </where> </delete>
</mapper>
|