|
@@ -355,4 +355,91 @@
|
355
|
355
|
and ptcl.podr_dtl_st_cd = 'POD0'
|
356
|
356
|
</select>
|
357
|
357
|
|
|
358
|
+ <select id="selectDeliGridList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
|
|
359
|
+ select info.brand_id, fn_brand_nm(info.brand_id) as brand_nm, info.dlv_sttmt_unq_no
|
|
360
|
+ , info.spply_id, info.spply_nm, info.dlv_st_cd, fn_code_nm(upper('dlv_st_cd'), info.dlv_st_cd) as dlv_st_nm
|
|
361
|
+ , info.whs_id, info.location, fn_whs_nm(info.brand_id, info.whs_id) as whs_nm
|
|
362
|
+ , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
|
|
363
|
+ , date_format(info.podr_reg_dt, '%Y.%m.%d') as podr_reg_dt, date_format(info.dlv_req_dt, '%y.%m.%d') as dlv_req_dt
|
|
364
|
+ , date_format(info.dlv_reg_dt, '%Y.%m.%d') as dlv_req_dt, date_format(info.dlv_sch_dt, '%y.%m.%d') as dlv_sch_dt
|
|
365
|
+ , ptcl.item_id as 'deliDtlMgntInfo.item_id', ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
|
|
366
|
+ , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
|
|
367
|
+ , ptcl.unit as 'deliDtlMgntInfo.unit', ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
|
|
368
|
+ , info.dlv_mgr_nm , info.dlv_mgr_mbl_no
|
|
369
|
+ from deli_info_mgnt info
|
|
370
|
+ , deli_dtl_ptcl ptcl
|
|
371
|
+ where 1 = 1
|
|
372
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
373
|
+ and info.brand_id = #{sBrandId}
|
|
374
|
+ <if test="dtGubun eq '1'.toString()">
|
|
375
|
+ and info.podr_reg_dt between #{fromDt} and #{toDt} -- 1인경우 발주생성일로 조회
|
|
376
|
+ </if>
|
|
377
|
+ <if test="dtGubun eq '2'.toString()">
|
|
378
|
+ and info.dlv_req_dt between #{fromDt} and #{toDt} -- 2인경우 납품요청일로 조회
|
|
379
|
+ </if>
|
|
380
|
+ <if test="dtGubun eq '3'.toString()">
|
|
381
|
+ and info.dlv_reg_dt between #{fromDt} and #{toDt} -- 3인경우 납품생성일로 조회
|
|
382
|
+ </if>
|
|
383
|
+ <if test="sDlvStCd != null and sDlvStCd != ''">
|
|
384
|
+ and info.dlv_st_cd = #{sDlvStCd} -- 납품상태
|
|
385
|
+ </if>
|
|
386
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
387
|
+ and info.spply_id = #{sSpplyId}
|
|
388
|
+ </if>
|
|
389
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
390
|
+ and info.whs_id = #{sWhsId}
|
|
391
|
+ </if>
|
|
392
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
393
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
394
|
+ </if>
|
|
395
|
+ <choose>
|
|
396
|
+ <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
|
|
397
|
+ <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
|
|
398
|
+ <if test="gridRequest.sord == 'asc'.toString()">
|
|
399
|
+ order by pch_req_unq_no asc
|
|
400
|
+ </if>
|
|
401
|
+ <if test="gridRequest.sord == 'desc'.toString()">
|
|
402
|
+ order by pch_req_unq_no desc
|
|
403
|
+ </if>
|
|
404
|
+ </if>
|
|
405
|
+ </when>
|
|
406
|
+ <otherwise>
|
|
407
|
+ order by pch_req_unq_no desc
|
|
408
|
+ </otherwise>
|
|
409
|
+ </choose>
|
|
410
|
+ <if test="gridRequest.pagingYn == true">
|
|
411
|
+ limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
|
|
412
|
+ </if>
|
|
413
|
+ </select>
|
|
414
|
+
|
|
415
|
+ <select id="selectDeliGridCnt" resultType="int">
|
|
416
|
+ select count(*)
|
|
417
|
+ from deli_info_mgnt info
|
|
418
|
+ , deli_dtl_ptcl ptcl
|
|
419
|
+ where 1 = 1
|
|
420
|
+ and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
|
|
421
|
+ and info.brand_id = #{sBrandId}
|
|
422
|
+ <if test="dtGubun eq '1'.toString()">
|
|
423
|
+ and info.podr_reg_dt between #{fromDt} and #{toDt} -- 1인경우 발주생성일로 조회
|
|
424
|
+ </if>
|
|
425
|
+ <if test="dtGubun eq '2'.toString()">
|
|
426
|
+ and info.dlv_req_dt between #{fromDt} and #{toDt} -- 2인경우 납품요청일로 조회
|
|
427
|
+ </if>
|
|
428
|
+ <if test="dtGubun eq '3'.toString()">
|
|
429
|
+ and info.dlv_reg_dt between #{fromDt} and #{toDt} -- 3인경우 납품생성일로 조회
|
|
430
|
+ </if>
|
|
431
|
+ <if test="sDlvStCd != null and sDlvStCd != ''">
|
|
432
|
+ and info.dlv_st_cd = #{sDlvStCd} -- 납품상태
|
|
433
|
+ </if>
|
|
434
|
+ <if test="sSpplyId != null and sSpplyId != ''">
|
|
435
|
+ and info.spply_id = #{sSpplyId}
|
|
436
|
+ </if>
|
|
437
|
+ <if test="sWhsId != null and sWhsId != ''">
|
|
438
|
+ and info.whs_id = #{sWhsId}
|
|
439
|
+ </if>
|
|
440
|
+ <if test="sItemNm != null and sItemNm != ''">
|
|
441
|
+ and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
|
|
442
|
+ </if>
|
|
443
|
+ </select>
|
|
444
|
+
|
358
|
445
|
</mapper>
|