104 lines
4.0 KiB
XML
104 lines
4.0 KiB
XML
<?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.foreverwin.iep.qms.mapper.QmsQcPlanMapper">
|
|
|
|
<resultMap id="qmsQcPlanMap" type="com.foreverwin.iep.qms.entity.QmsQcPlan">
|
|
<id property="handle" column="HANDLE"/>
|
|
<result property="site" column="SITE"/>
|
|
<result property="qcPlan" column="QC_PLAN"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="currentRevision" column="CURRENT_REVISION"/>
|
|
<result property="description" column="DESCRIPTION"/>
|
|
<result property="inspecType" column="INSPEC_TYPE"/>
|
|
<result property="inspecFreqBo" column="INSPEC_FREQ_BO"/>
|
|
<result property="userGroup" column="USER_GROUP"/>
|
|
<result property="toSpc" column="TO_SPC"/>
|
|
<result property="dateCreate" column="DATE_CREATE"/>
|
|
<result property="dateUpdate" column="DATE_UPDATE"/>
|
|
<result property="creator" column="CREATOR"/>
|
|
<result property="updater" column="UPDATER"/>
|
|
<result property="calibrationType" column="CALIBRATION_TYPE"/>
|
|
<result property="calibrationFreq" column="CALIBRATION_FREQ"/>
|
|
<result property="samplePlan" column="SAMPLE_PLAN"/>
|
|
<result property="qcSubCategories" column="QC_SUB_CATEGORIES"/>
|
|
<result property="checkUserGroup" column="CHECK_USER_GROUP"/>
|
|
<result property="item" column="ITEM"/>
|
|
<result property="itemDesc" column="ITEM_DESC"/>
|
|
<result property="itemBo" column="ITEM_BO"/>
|
|
<result property="operation" column="OPERATION"/>
|
|
<result property="operationDesc" column="OPERATION_DESC"/>
|
|
<result property="operationBo" column="OPERATION_BO"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="userGroupMap" type="com.foreverwin.iep.qms.domain.UserGroup">
|
|
<result property="userGroup" column="USER_GROUP"/>
|
|
<result property="roleName" column="ROLE_NAME"/>
|
|
<result property="roleDesc" column="ROLE_DESC"/>
|
|
</resultMap>
|
|
|
|
<select id="getUserGroup" resultMap="userGroupMap">
|
|
select distinct a.user_group
|
|
from QMS_QC_PLAN a
|
|
where a.site = #{site}
|
|
<if test="userGroup != '' and userGroup != null">
|
|
and a.user_group like concat('%', concat(#{userGroup}, '%'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getDistinctQcPlan" resultMap="qmsQcPlanMap">
|
|
select distinct A.QC_PLAN, A.DESCRIPTION, A.INSPEC_TYPE
|
|
from QMS_QC_PLAN a
|
|
where a.site = #{site}
|
|
<if test="qcPlan != '' and qcPlan != null">
|
|
and a.qc_plan like concat('%', concat(#{qcPlan},'%'))
|
|
</if>
|
|
</select>
|
|
|
|
<select id="getListPage" resultMap="qmsQcPlanMap">
|
|
|
|
</select>
|
|
|
|
<!--获取角色-->
|
|
<select id="getRoleCode" resultType="com.foreverwin.mom.admin.api.entity.SysRole">
|
|
select
|
|
sr.ROLE_CODE
|
|
from
|
|
momx.sys_role sr
|
|
where
|
|
sr.TENANT_ID = #{site}
|
|
and sr.ROLE_CODE = #{roleCode}
|
|
and sr.DEL_FLAG = '0'
|
|
</select>
|
|
|
|
<!--查询字典-->
|
|
<select id="selectSysDictItemList" resultType="com.foreverwin.mom.admin.api.entity.SysDictItem">
|
|
select
|
|
sdi.ITEM_VALUE,
|
|
sdi.LABEL
|
|
from
|
|
momx.sys_dict_item sdi
|
|
where
|
|
sdi.TENANT_ID = #{site}
|
|
and sdi.DEL_FLAG = '0'
|
|
and sdi.DICT_TYPE = #{dictType}
|
|
</select>
|
|
|
|
<!--通过检验细类+工序+物料确定唯一计划-->
|
|
<select id="selectListByTarget" resultType="com.foreverwin.iep.qms.entity.QmsQcPlan">
|
|
select
|
|
qqpt.QC_PLAN
|
|
from
|
|
wip.qms_qc_plan_target qqpt
|
|
inner join wip.qms_qc_plan qqp on
|
|
qqp.SITE = qqpt.SITE
|
|
and qqp.QC_PLAN = qqpt.QC_PLAN
|
|
and qqp.CURRENT_REVISION = 'Y'
|
|
and qqp.QC_SUB_CATEGORIES = #{qcSubCategories}
|
|
where
|
|
qqpt.SITE = #{site}
|
|
and qqpt.TARGET_BO = #{targetBo}
|
|
</select>
|
|
</mapper>
|