| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?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.example.backend.mapper.contract.CustCtrlMapper">
-
-
- <select id="selectOurNameByFoursname" resultType="com.example.backend.entity.common.CustCtrl">
- select a.id,a.fno,a.cpal,a.cpny,a.addr,a.namee,a.addrc,a.signLoc ,
- case when nvl(b.bankNm,'')='' then '无' else nvl(b.bankNm,'') end as ourBankNm,
- case when nvl(b.bankAcct,'')='' then '无' else nvl(b.bankAcct,'') end as ourBankAcct
- from SGGMIIP.addrctrl a
- LEFT JOIN (
- SELECT stopBank,rid , bankNm , bankAcct , ROW_NUMBER() OVER (PARTITION BY rid ORDER BY id) as row_num
- FROM SGGMIIP.custbank WHERE NVL(del_flag, 0) != 1 and stopBank='否'
- ) b ON a.id = b.rid AND b.row_num = 1
- where ifnull(a.del_flag, 0) != 1
- and NVL(a.placed, '0') = '2'
- and a.cpny = #{foursname}
- order by a.fno desc
- </select>
- <select id="selectLPortByLportName" resultType="com.example.backend.entity.common.CustCtrl">
- select fno,portName,portCd,portNm,country,countryName
- from SGGMIIP.portCtrl
- where nvl(del_flag, 0) !=1
- and isnull(country,'')!=''
- and portName = #{lPort}
- order by fno
- </select>
- <select id="selectByAgentNo" resultType="com.example.backend.entity.common.CustCtrl">
- select a.fno,a.fdate,a.foursname,a.ctName
- from SGGMIIP.ImpAgencyAgt a
- where ifnull(a.del_flag, 0) != 1
- and ifnull(a.placed,'')='2'
- and a.fno = #{agentNo}
- order by a.fdate desc
- </select>
- <select id="selectByAgentNoSo" resultType="com.example.backend.entity.common.CustCtrl">
- select a.fno,a.fdate,a.foursname,a.ctName
- from SGGMIIP.ExpAgencyAgt a
- where ifnull(a.del_flag, 0) != 1
- and ifnull(a.placed,'')='2'
- and a.fno =#{agentNoSo}
- order by a.fdate desc
- </select>
- <select id="selectCommContrNo" resultType="com.example.backend.entity.common.CustCtrl">
- select a.fno
- from SGGMIIP.otherTContract a
- where ifnull(a.del_flag, 0) != 1
- and ifnull(a.contrType, '') = '佣金合同'
- and a.fno =#{commContrNo}
- and not exists (
- select 1
- from SGGMIIP.t_ctc_sales_Contract B
- where B.commContrNo = A.fno
- )
- order by a.fdate desc
- </select>
- <select id="selectByItemno" resultType="com.example.backend.entity.common.CustCtrl">
- select b.type_name2,
- a.itemno,
- a.sdesc,
- a.edesc,
- a.ut,
- a.hsCode,
- a.hsNameCn,
- a.hsNameEn,
- a.inTaxRate,
- a.brand
- from SGGMIIP.invitem a
- left join (select fno, type_name type_name2
- from SGGMIIP.product_category
- where nvl(del_flag, 0) != 1
- and level = 0
- and parent_id = 0) b on SUBSTR(a.itemno, 1, 2) = b.fno
- where ifnull(a.del_flag, 0) != 1
- and b.type_name2 = #{bizProductType}
- and a.itemno = #{itemno}
- </select>
- <select id="selectByCurcyPo" resultType="com.example.backend.entity.common.CustCtrl">
- select a.id
- , a.fname
- , a.fname1
- , (select rate
- from SGGMIIP.curcydtl
- where a.id = rid
- and targetcode = 'CNY'
- and del_flag != 1) as rate
- , (select rate
- from SGGMIIP.curcydtl
- where a.id = rid
- and targetcode = 'USD'
- and del_flag != 1) as rateUsd
- from SGGMIIP.curcyctrl A
- where ifnull(a.del_flag, 0) != 1
- and ifnull(a.placed, '') = '2'
- and a.fname = #{curcyPo}
- group by a.id, a.fname, a.fname1
- </select>
- <select id="selectByResourceNo" resultType="com.example.backend.entity.common.CustCtrl">
- select a.fno
- from SGGMIIP.resourcectrl a
- where ifnull(a.del_flag, 0) != 1
- and ifnull(a.placed, '')='2'
- and typename=#{bizProductType}
- and a.fno =#{resourceNo}
- order by a.fdate desc,a.fno
- </select>
- <select id="selectByFtype3" resultType="com.example.backend.entity.common.CustCtrl">
- select steelProductSpecNo,steelProductSpecularity,fnum4
- from SGGMIIP.steelProductSpec
- where ifnull(del_flag, 0) != 1
- and steelProductSpecularity =#{ftype3}
- </select>
- <select id="selectByOurBankNm" resultType="com.example.backend.entity.common.CustCtrl">
- select a.bankNm,a.bankAcct
- from SGGMIIP.custbank a
- left join SGGMIIP.addrctrl b on a.rid = b.id
- where ifnull(a.del_flag, 0) != 1
- and a.stopBank='否'
- and a.bankNm =#{ourBankNm}
- </select>
- <select id="selectByOurBankAcct" resultType="com.example.backend.entity.common.CustCtrl">
- select a.bankNm,a.bankAcct
- from SGGMIIP.custbank a
- left join SGGMIIP.addrctrl b on a.rid = b.id
- where ifnull(a.del_flag, 0) != 1
- and a.stopBank='否'
- and a.bankNm =#{ourBankAcct}
- </select>
- <select id="selectByPersonDeptNm" resultType="com.example.backend.entity.common.CustCtrl">
- SELECT
- t.fno,
- t.cpny,
- t.deptname as deptName,
- t.deptcode as deptCode
- FROM (
- SELECT DISTINCT
- c.fno,
- c.cpny,
- a.deptname,
- a.deptcode
- FROM SGGMIIP.View_Dept_Code a
- LEFT JOIN SGGMIIP.View_User_Code b ON a.deptid = b.dept_id
- LEFT JOIN SGGMIIP.addrctrl c ON a.fourscode = c.hrDeptCode
- ) t
- where t.deptname =#{personDeptNm}
- </select>
- <select id="selectByFeeNm" resultType="com.example.backend.entity.common.CustCtrl">
- select cateCode,cateName,feeCd,feeNm,allocationCategory
- from SGGMIIP.fytypedtl
- where ifnull(del_flag, 0) != 1
- and feeNm = #{feeNm}
- order by cateCode,feeCd
- </select>
- </mapper>
|