Commit d54b3c7f by wuwenlong

sql hpjx to schema

parent 50ad3625
......@@ -125,8 +125,8 @@
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC006">
SELECT
<include refid="column"/>
FROM HPJX.T_HPKC006 A
LEFT JOIN HPJX.T_HPPZ006 B ON A.INVENT_RECORD_ID = B.ID
FROM ${hpjxSchema}.T_HPKC006 A
LEFT JOIN ${hpjxSchema}.T_HPPZ006 B ON A.INVENT_RECORD_ID = B.ID
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......
......@@ -241,8 +241,8 @@
SELECT DISTINCT
B.FACTORY_CODE as "factoryCode",
B.FACTORY_NAME as "factoryName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
</select>
......@@ -251,8 +251,8 @@
SELECT DISTINCT
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
......@@ -265,8 +265,8 @@
SELECT DISTINCT
A.PROJ_CODE as "projCode",
A.PROJ_NAME as "projName"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
......@@ -283,8 +283,8 @@
A.PRDT_CODE as "prdtCode",
A.PRDT_NAME as "prdtName",
A.PRDT_SPEC as "prdtSpec"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
......@@ -304,8 +304,8 @@
A.PART_CODE as "partCode",
A.PART_NAME as "partName",
A.PART_SPEC as "partSpec"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
......@@ -327,8 +327,8 @@
SELECT DISTINCT
B.PROD_TASK_NO as "prodTaskNo",
B.PROD_ORDER_NO as "prodorderNo"
FROM HPJX.`t_hpsc005` A LEFT JOIN (
SELECT * FROM HPJX.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
FROM ${hpjxSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hpjxSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
......@@ -412,24 +412,24 @@
<select id="kcEnterPmList" resultClass="java.util.HashMap">
select distinct A.PROJ_CODE as "projCode",A.PROJ_NAME as "projName"
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
INNER JOIN ${hpjxSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.COMPANY_CODE = #companyCode# AND B.NUM - B.COMPLETE_NUM > 0
AND B.ORG_NO != 'R24050801'
</select>
<select id="kcEnterPrdtList" resultClass="java.util.HashMap">
select distinct A.PRDT_CODE as "prdtCode",A.PRDT_NAME as "prdtName"
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
INNER JOIN ${hpjxSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.PROJ_CODE = #projCode# and A.COMPANY_CODE = #companyCode#
AND B.NUM - B.COMPLETE_NUM > 0 AND B.ORG_NO != 'R24050801'
</select>
<select id="kcEnterPartList" resultClass="java.util.HashMap">
select distinct A.PART_CODE as "partCode",A.PART_NAME as "partName"
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
INNER JOIN ${hpjxSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.PROJ_CODE = #projCode# and A.COMPANY_CODE = #companyCode#
and A.PRDT_CODE = #prdtCode# AND B.NUM - B.COMPLETE_NUM > 0 AND B.ORG_NO != 'R24050801'
</select>
......
......@@ -405,7 +405,7 @@
<select id="queryEntityByParentPrtdCode" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ015A">
SELECT
<include refid="column"/>
FROM HPJX.t_hppz015a
FROM ${hpjxSchema}.t_hppz015a
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......
......@@ -463,7 +463,7 @@
<select id="queryEntityByParentPrtdCode" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC002">
SELECT
<include refid="column"/>
FROM HPJX.T_HPSC002
FROM ${hpjxSchema}.T_HPSC002
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......
......@@ -395,8 +395,8 @@
SELECT
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NO ELSE A.ORG_NO END) AS "orgNo",
(CASE WHEN A.DOCUMENT_TYPE = 1 THEN B.ORG_NAME ELSE A.ORG_NAME END) AS "orgName"
FROM HPJX.T_HPSC005 A
LEFT JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
LEFT JOIN ${hpjxSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
......
......@@ -142,11 +142,11 @@
<select id="query" resultClass="com.baosight.hpjx.hp.sc.domain.HPSC005B">
SELECT
<include refid="column"/>
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
INNER JOIN ${hpjxSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
LEFT JOIN ( SELECT
DISTINCT PROD_TASK_NO
FROM HPJX.T_HPZL001 WHERE 1=1 AND DELETE_FLAG = 0 AND STATUS = 0) C ON B.PROD_TASK_NO = C.PROD_TASK_NO
FROM ${hpjxSchema}.T_HPZL001 WHERE 1=1 AND DELETE_FLAG = 0 AND STATUS = 0) C ON B.PROD_TASK_NO = C.PROD_TASK_NO
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......@@ -156,8 +156,8 @@
<!-- 选择生产任务 -->
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM HPJX.T_HPSC005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PROD_ORDER_NO
FROM ${hpjxSchema}.T_HPSC005 A
INNER JOIN ${hpjxSchema}.T_HPSC005A B ON A.PRODUCTION_ORDER_NO = B.PROD_ORDER_NO
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment