sqlMap.append(" WOSN_CODE,GX.GZZX_ID as GZZX_ID, GX.GZZX_NAME as GZZX_NAME, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.GZZX_ID ");
sqlMap.append(" GX.BZGX_NAME as BZGX_NAME,GX.GPFK_FKR as GPFK_FKR, ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.GZZX_ID ");
sqlMap.append(" GX.GPFK_FKSJ as GPFK_CZSJ, GX.BX_ID as BX_ID, GX.BX_NAME as BX_NAME ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.GZZX_ID ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.GZZX_ID ");
sqlMap.append(" end as GZZX_ID, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.GZZX_NAME ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.GZZX_NAME ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.GZZX_NAME ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.GZZX_NAME ");
sqlMap.append(" end as GZZX_NAME, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.BZGX_NAME ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.BZGX_NAME ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.BZGX_NAME ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.BZGX_NAME ");
sqlMap.append(" end as BZGX_NAME, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.GPFK_FKR ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.GPFK_FKR ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.GPFK_FKR ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.GPFK_FKR ");
sqlMap.append(" end as GPFK_FKR , ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.GPFK_FKSJ ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.GPFK_FKSJ ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.GPFK_FKSJ ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.GPFK_FKSJ ");
sqlMap.append(" end as GPFK_CZSJ, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.BX_ID ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.BX_ID ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.BX_ID ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.BX_ID ");
sqlMap.append(" end as BX_ID, ");
sqlMap.append(" case when (isnull(ZT.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZT.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZT.BX_NAME ");
sqlMap.append(" when (isnull(ZX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) and isnull(ZX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0)) then ZX.BX_NAME ");
sqlMap.append(" when (isnull(GX.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(GX.GPFK_FKSJ,0) > isnull(KC.GPFK_FKSJ,0) ) then GX.BX_NAME ");
sqlMap.append(" when (isnull(KC.GPFK_FKSJ,0) > isnull(ZT.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(ZX.GPFK_FKSJ,0) and isnull(KC.GPFK_FKSJ,0) > isnull(GX.GPFK_FKSJ,0) ) then KC.BX_NAME ");
sqlMap.append(" end as BX_NAME ");
sqlMap.append(" from WOSN ");
sqlMap.append(" from WOSN ");
sqlMap.append(" left join WO on WO_ID = WOSN_WOID ");
sqlMap.append(" left join WO on WO_ID = WOSN_WOID ");
sqlMap.append(" left join GC on GC_ID = WO_GCID ");
sqlMap.append(" left join GC on GC_ID = WO_GCID ");
...
@@ -405,42 +370,8 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -405,42 +370,8 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap.append(" group by GPFK_WOSNID ");
sqlMap.append(" group by GPFK_WOSNID ");
sqlMap.append(" ) ");
sqlMap.append(" ) ");
sqlMap.append(" ) GX on GX.GPFK_WOSNID = WOSN_CODE ");
sqlMap.append(" ) GX on GX.GPFK_WOSNID = WOSN_CODE ");
sqlMap.append(" left join (select U_ZXGL_NRID as GPFK_WOSNID,GZZX_ID,GZZX_NAME,U_ZXGL_CJSJ as GPFK_FKSJ,U_ZXGL_CJR as GPFK_FKR,'装箱' as BZGX_NAME , ");
sqlMap.append(" BX_ID,BX_NAME from U_ZXGL B ");
sqlMap.append(" left join U_ZXSN on U_ZXSN_CODE = B.U_ZXGL_ZXSNID ");
sqlMap.append(" left join GZZX on GZZX_ID = U_ZXSN_GZZXID ");
sqlMap.append(" left join BX on BX_ID = U_ZXSN_BX ");
sqlMap.append(" where U_ZXGL_CJSJ = (select max(U_ZXGL_CJSJ) as fksj ");
sqlMap.append(" from U_ZXGL ");
sqlMap.append(" where 1 = 1 ");
sqlMap.append(" and U_ZXGL_NRID = B.U_ZXGL_NRID ");
sqlMap.append(" group by U_ZXGL_NRID ");
sqlMap.append(" ) ");
sqlMap.append(" ) ZX on ZX.GPFK_WOSNID = WOSN_CODE ");
sqlMap.append(" left join (select U_ZXGL_NRID as GPFK_WOSNID,'ZT001'as GZZX_ID, '装托工作中心' as GZZX_NAME, U_ZTGL_CJSJ as GPFK_FKSJ,U_ZTGL_CJR as GPFK_FKR,'装拖' as BZGX_NAME,");
sqlMap.append(" '' as BX_ID,'' as BX_NAME from U_ZTGL C ");
sqlMap.append(" left join U_ZXGL D on U_ZXGL_ZXSNID = U_ZTGL_NRID ");
sqlMap.append(" where U_ZTGL_CJSJ = (select max(U_ZTGL_CJSJ) as fksj ");
sqlMap.append(" from U_ZTGL ");
sqlMap.append(" left join U_ZXGL on U_ZXGL_ZXSNID = C.U_ZTGL_NRID ");
sqlMap.append(" where 1 = 1 ");
sqlMap.append(" and U_ZXGL_NRID = D.U_ZXGL_NRID ");
sqlMap.append(" group by U_ZXGL_NRID ");
sqlMap.append(" ) ");
sqlMap.append(" )ZT on ZT.GPFK_WOSNID = WOSN_CODE ");
sqlMap.append(" left join (select KCSW_SNID as GPFK_WOSNID, KCSW_CJSJ as GPFK_FKSJ,KCSW_CJR as GPFK_FKR,'CK001'as GZZX_ID, '仓库工作中心' as GZZX_NAME,");
sqlMap.append(" '' as BX_ID,'' as BX_NAME , case SWLX_XTSWLXID when 'QTRK' then '入库' when 'QTCK' then '出库' end as BZGX_NAME from KCSW E ");
sqlMap.append(" left join KC on KC_ID = KCSW_MID ");
sqlMap.append(" left join SWLX on SWLX_ID = KC_SWLXID ");
sqlMap.append(" where KCSW_CJSJ = (select max(KCSW_CJSJ) as fksj ");
sqlMap.append(" from KCSW ");
sqlMap.append(" where 1 = 1 ");
sqlMap.append(" and isnull(KCSW_SNID,' ') <> ' ' ");
sqlMap.append(" and KCSW_SNID = E.KCSW_SNID ");
sqlMap.append(" group by KCSW_SNID ");
sqlMap.append(" ) ");
sqlMap.append(" ) KC on KC.GPFK_WOSNID = WOSN_CODE ");
sqlMap.append(" RIGHT('0'+CAST(isnull(datepart(wk,WOSN_CJSJ),'0') as varchar(10)),2) as SNWEEK, ");
sqlMap.append(" RIGHT('0'+CAST(isnull(datepart(wk,WOSN_CJSJ),'0') as varchar(10)),2) as SNWEEK, substring(convert( nvarchar,datepart(year ,getdate())) ,3, 4) as SNYEAR ");
sqlMap.append(" substring(convert( nvarchar,datepart(year ,getdate())) ,3, 4) as SNYEAR ");
sqlMap.append("from GPFK ");
sqlMap.append("from GPFK ");
sqlMap.append(" left join BX on BX_ID = GPFK_FKBX ");
sqlMap.append(" left join BX on BX_ID = GPFK_FKBX ");
sqlMap.append(" left join WOSN on WOSN_CODE = GPFK_WOSNID ");
sqlMap.append(" left join WOSN on WOSN_CODE = GPFK_WOSNID ");
...
@@ -1202,7 +1068,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -1202,7 +1068,7 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
HZGD_JYJL_JYBM("HZGDU001","用户可操作的检验部门","U","用户可操作的检验部门","E","select BM_ID as ID, BM_CODE as CODE, BM_NAME as NAME from BM where isnull(BM_TYBZ,'N')='N' order by BM_CODE","",""),
HZGD_BM("HZGDU001","用户可操作的检验部门","U","用户可操作的检验部门","E","select BM_ID as ID, BM_CODE as CODE, BM_NAME as NAME from BM where isnull(BM_TYBZ,'N')='N' order by BM_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' and BZGX_GXLX = 'JG' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' and BZGX_GXLX = 'JY' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","",""),
HZGD_JYJL_DPJYBM("HZGDB012","设置部门为大屏检验部门","B","设置部门为大屏检验部门","E","select BM_ID as ID, BM_CODE as CODE, BM_NAME as NAME from BM where isnull(BM_TYBZ,'N')='N' order by BM_CODE","",""),
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' and BZGX_GXLX = 'JG' order by BZGX_CODE","",""),
HZGD_JYJL_DPZZBM("HZGDB015","设置部门为大屏制造部门","B","设置部门为大屏制造部门","E","select BM_ID as ID, BM_CODE as CODE, BM_NAME as NAME from BM where isnull(BM_TYBZ,'N')='N' order by BM_CODE","",""),
HZGD_WOZPJH_FLID("HZGDB033","生产装配计划选择的物料分类","B","生产装配计划选择的物料分类","E","select WLFL_ID as ID, WLFL_CODE as CODE, WLFL_NAME as NAME from WLFL where 1=1 order by WLFL_CODE","","");
"select BZGX_ID as ID, BZGX_CODE as CODE, BZGX_NAME || '--' || GZZX_NAME as NAME from BZGX left join GZZX on GZZX_ID = BZGX_GZZXID where isnull(BZGX_TYBZ,'N')='N' order by BZGX_CODE","","");