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.
 
 
 
 
 
 

165 lines
9.7 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="com.xujie.modules.part.dao.PartMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.xujie.modules.part.entity.Part">
<id column="id" property="id" />
<result column="site" property="site" />
<result column="part_no" property="partNo" />
<result column="part_desc" property="partDesc" />
<result column="remark" property="remark" />
<result column="create_by" property="createBy" />
<result column="create_date" property="createDate" />
<result column="update_by" property="updateBy" />
<result column="update_date" property="updateDate" />
<result column="npc" property="npc" />
<result column="part_spec" property="partSpec" />
<result column="buyer_name" property="buyerName" />
<result column="buyer_id" property="buyerId" />
<result column="sourcing_name" property="sourcingName" />
<result column="sourcing_id" property="sourcingId" />
<result column="category" property="category" />
<result column="unit" property="unit" />
<result column="status" property="status" />
<result column="code_no" property="codeNo" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="BaseColumnList">
site, part_no, part_desc, remark, create_by, create_date, update_by, update_date, npc, part_spec, buyer_name, buyer_id, sourcing_name, sourcing_id, category, unit, status, code_no, id
</sql>
<select id="getListByModel" resultType="com.xujie.modules.part.entity.Part">
select <include refid="BaseColumnList" />
from part
where 1=1
<if test="site != null and site != '' "> and site = #{site}</if>
<if test="partNo != null and partNo != '' "> and part_no = #{partNo}</if>
<if test="partDesc != null and partDesc != '' "> and part_desc = #{partDesc}</if>
<if test="remark != null and remark != '' "> and remark = #{remark}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null and createDate != '' "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null and updateDate != '' "> and update_date = #{updateDate}</if>
<if test="npc != null and npc != '' "> and npc = #{npc}</if>
<if test="partSpec != null and partSpec != '' "> and part_spec = #{partSpec}</if>
<if test="buyerName != null and buyerName != '' "> and buyer_name = #{buyerName}</if>
<if test="buyerId != null "> and buyer_id = #{buyerId}</if>
<if test="sourcingName != null and sourcingName != '' "> and sourcing_name = #{sourcingName}</if>
<if test="sourcingId != null "> and sourcing_id = #{sourcingId}</if>
<if test="category != null and category != '' "> and category = #{category}</if>
<if test="unit != null and unit != '' "> and unit = #{unit}</if>
<if test="status != null "> and status = #{status}</if>
<if test="codeNo != null and codeNo != '' "> and code_no = #{codeNo}</if>
<if test="id != null "> and id = #{id}</if>
ORDER BY id
</select>
<select id="myPage" resultType="com.xujie.modules.part.vo.PartVo">
select
<include refid="BaseColumnList"/>
from part
where site = '${query.site}'
<if test="query.id != null "> and id = '${query.id}'</if>
<if test="query.partNo != null and query.partNo != '' "> and part_no like '%${query.partNo}%'</if>
<if test="query.partDesc != null and query.partDesc != '' "> and part_desc like '%${query.partDesc}%'</if>
<if test="query.remark != null and query.remark != '' "> and remark like '%${query.remark}%'</if>
<if test="query.createBy != null and query.createBy != '' "> and create_by like '%${query.createBy}%'</if>
<if test="query.createDate != null "> and create_date like '%${query.createDate}%'</if>
<if test="query.updateBy != null and query.updateBy != '' "> and update_by like '%${query.updateBy}%'</if>
<if test="query.updateDate != null "> and update_date like '%${query.updateDate}%'</if>
<if test="query.npc != null and query.npc != '' "> and npc like '%${query.npc}%'</if>
<if test="query.partSpec != null and query.partSpec != '' "> and part_spec like '%${query.partSpec}%'</if>
<if test="query.buyerName != null and query.buyerName != '' "> and buyer_name like '%${query.buyerName}%'</if>
<if test="query.buyerId != null "> and buyer_id = '${query.buyerId}'</if>
<if test="query.sourcingName != null and query.sourcingName != '' "> and sourcing_name like '%${query.sourcingName}%'</if>
<if test="query.sourcingId != null "> and sourcing_id = '${query.sourcingId}'</if>
<if test="query.category != null and query.category != '' "> and category like '%${query.category}%'</if>
<if test="query.unit != null and query.unit != '' "> and unit like '%${query.unit}%'</if>
<if test="query.status != null and query.status != ''"> and status = '${query.status}'</if>
<if test="query.codeNo != null and query.codeNo != '' "> and code_no like '%${query.codeNo}%'</if>
ORDER BY id
</select>
<select id="getAvailableValueList" resultType="com.xujie.modules.base.data.PlmPropertiesItemAvailableData">
select
ItemNo,
ValueNo,
AvailableValue
from plm_properties_item_available
where itemNo = #{propertiesItemNo} and site = #{site} and ItemType = #{recordType}
</select>
<select id="searchPartApproveList" resultType="com.xujie.modules.part.vo.PartVo">
select
ni.apply_no,
ni.node_code,
ni.attempt_no,
ni.site,
ni.order_type,
ni.assignee_user_id,
ni.assignee_name,
ni.special_release,
ni.department_id,
ni.department_name,
i.status as flowStatus,
p.part_stage,
p.part_no,
p.part_desc,
p.remark,
p.create_by,
p.create_date,
p.update_by,
p.update_date,
p.npc,
p.part_spec,
p.buyer_name,
p.buyer_id,
p.sourcing_name,
p.sourcing_id,
p.category,
p.unit,
p.status,
p.code_no,
p.id
from erf_flow_node_instance ni
left join erf_flow_instance i on ni.apply_no = i.apply_no and ni.site = i.site and ni.order_type = i.order_type
left join part p on i.order_ref1 = p.part_no and i.site = p.site
where ni.site = '${query.site}'
and ni.status = 'PENDING'
and ni.order_type = '${query.orderType}'
and p.id is not null
<if test="query.id != null "> and ni.id = '${query.id}'</if>
<if test="query.partNo != null and query.partNo != '' "> and p.part_no like '%${query.partNo}%'</if>
<if test="query.partDesc != null and query.partDesc != '' "> and p.part_desc like '%${query.partDesc}%'</if>
<if test="query.remark != null and query.remark != '' "> and p.remark like '%${query.remark}%'</if>
<if test="query.createBy != null and query.createBy != '' "> and p.create_by like '%${query.createBy}%'</if>
<if test="query.createDate != null "> and p.create_date like '%${query.createDate}%'</if>
<if test="query.updateBy != null and query.updateBy != '' "> and p.update_by like '%${query.updateBy}%'</if>
<if test="query.updateDate != null "> and p.update_date like '%${query.updateDate}%'</if>
<if test="query.npc != null and query.npc != '' "> and p.npc like '%${query.npc}%'</if>
<if test="query.partSpec != null and query.partSpec != '' "> and p.part_spec like '%${query.partSpec}%'</if>
<if test="query.buyerName != null and query.buyerName != '' "> and p.buyer_name like '%${query.buyerName}%'</if>
<if test="query.buyerId != null "> and p.buyer_id = '${query.buyerId}'</if>
<if test="query.sourcingName != null and query.sourcingName != '' "> and p.sourcing_name like '%${query.sourcingName}%'</if>
<if test="query.sourcingId != null "> and p.sourcing_id = '${query.sourcingId}'</if>
<if test="query.category != null and query.category != '' "> and p.category like '%${query.category}%'</if>
<if test="query.unit != null and query.unit != '' "> and p.unit like '%${query.unit}%'</if>
<if test="query.status != null and query.status != ''"> and p.status = '${query.status}'</if>
<if test="query.codeNo != null and query.codeNo != '' "> and p.code_no like '%${query.codeNo}%'</if>
<if test="query.partStage != null and query.partStage != ''"> and p.part_stage = '${query.partStage}'</if>
<if test="query.flowStatus != null and query.flowStatus != ''"> and i.flow_status = '${query.flowStatus}'</if>
<if test="query.applyNo != null and query.applyNo != ''"> and i.apply_no like '%${query.applyNo}%'</if>
<if test="query.nodeCode != null and query.nodeCode != ''"> and ni.node_code = '${query.nodeCode}'</if>
<if test="query.specialRelease != null and query.specialRelease != ''"> and ni.special_release = '${query.specialRelease}'</if>
<!-- 112 样式码表示 yyyyMMdd 格式-->
<if test="query.startDate != null ">
AND CONVERT(varchar(8), ni.receive_time, 112) &gt;= #{query.startDate}
</if>
<if test="query.endDate != null ">
AND CONVERT(varchar(8), ni.receive_time, 112) &lt;= #{query.endDate}
</if>
order by p.id desc
</select>
</mapper>