123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <?xml version="1.0" encoding="utf-8" ?>
- <sqlMap namespace="CLIP.e-Form.Consent.Dfh" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
- <statements>
- <statement id="doLogin" parameterClass="System.Collections.Hashtable" resultMap="MobileLoginResultMap">
- <![CDATA[
- select usrb.usernm as usernm
- ,nvl(upwd.pwd, usrb.pwd) as pwd
- ,nvl(upwd.invalcnt,0) as invalcnt
- ,nvl(upwd.invalyn,'N') as invalyn
- ,nvl(upwd.invaldt,'-') as invaldt
- from (select userb.userid as userid
- ,userb.usernm as usernm
- ,userb.pwd as pwd
- from com.zsumusrb userb
- ,(select userid
- ,max(userfromdd) as userfromdd
- from com.zsumusrb
- where userid = #userid#
- group by userid) max_userb
- where userb.userid = max_userb.userid
- and userb.userfromdd = max_userb.userfromdd) usrb
- ,com.zsumupwd upwd
- where upwd.userid(+) = usrb.userid
- ]]>
- </statement>
- <statement id="getDeptListForConsent" parameterClass="System.Collections.Hashtable" resultMap="UserLoginDeptListResultMap">
- <![CDATA[
- SELECT EMPLNO,
- NAME,
- UNITCD,
- COM.FN_ZS_GETLATESTDEPTNM('111', UNITCD,TO_CHAR(SYSDATE,'YYYYMMDD')) UNITNM,
- decode(substr(COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD')), length(COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD'))) - 1),
- '외래', substr(DUTPLCEDEPTCD,1,6)||'0'||substr(DUTPLCEDEPTCD,8),DUTPLCEDEPTCD) as DUTPLCEDEPTCD,
- COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD')) DUTPLCEDEPTNM,
- JOBKINDCD,
- MIS.FN_RP_GETCOMCDNM('R0061', JOBKINDCD, TO_CHAR(SYSDATE,'YYYYMMDD')) JOBKINDNM,
- MOBILE,
- '' as MSG
- FROM MIS.RPBMEMPL
- WHERE EMPLNO = #userid#
- ]]>
- </statement>
- <statement id="GET_USER_INFO" parameterClass="System.Collections.Hashtable" resultMap="UserMap">
- <![CDATA[
- select a.userid,
- a.usernm,
- b.dutplcecd,
- dept.depthngnm,
- dept.deptengabbr,
- b.jobkindcd,
- (select cdnm
- from com.zbcmcode code
- where code.cdgrupid = 'R0061'
- and code.cdid = b.jobkindcd
- and code.valitodd = '99991231')
- from com.zsumusrb a,
- com.zsumusrd b,
- com.zsdddept dept
- where a.dutinstcd = '111'
- and a.dutinstcd = b.dutplceinstcd
- and a.userid = b.userid
- and a.usertodd = b.todd
- and dept.instcd = a.dutinstcd
- and dept.deptcd = b.dutplcecd
- and dept.valitodd = '99991231'
- and a.userfromdd <= to_char(to_date(sysdate),'YYYYMMDD')
- and a.usertodd >= to_char(to_date(sysdate),'YYYYMMDD')
- and b.userid = #userid#
- order by b.psnworkyn desc, b.fstrgstdt desc
- ]]>
- </statement>
- <!--
- <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
- <![CDATA[
- SELECT 'PERS_SET' AS SET_AUTH,
- 'bf159c4f-bb03-49ba-bc61-9d635f350c8d' AS FORM_GUID,
- '안와골절 정복술 설명 및 동의서' AS FORM_NAME,
- 109 AS FORM_RID,
- #userid# AS FORM_CD,
- 1 AS PRNTCNT
- FROM DUAL
- UNION ALL
- SELECT 'PERS_SET' AS SET_AUTH,
- '8095dad0-7318-4782-adfb-a2db2f0258e3' AS FORM_GUID,
- 'Safe Guard 사용 동의서' AS FORM_NAME,
- 110 AS FORM_RID,
- #userid# || '0000002' AS FORM_CD,
- 1 AS PRNTCNT
- FROM DUAL
- ]]>
- </statement>
- -->
-
- <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
- <![CDATA[
- SELECT 'PERS_SET' AS SET_AUTH,
- a.linkcd AS FORM_CD,
- b.form_name as FORM_NAME,
- b.form_guid,
- b.FORM_RID,
- b.prntcnt,
- b.PRINT_ONLY,
- b.OCRTAGPRNTYN
- FROM emr.MRFMSETINDX a
- INNER JOIN cmr.v_eform_formdoc b
- ON a.LINKCD = b.FORM_CD
- WHERE a.userid = #userid#
- AND a.instcd = #instcd#
- and a.valiyn = 'Y'
- ORDER BY FORM_NAME
- ]]>
- </statement>
-
- <!--<statement id="setUserFormSet" parameterClass="System.Collections.Hashtable">-->
- <update id="setUserFormSet" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- INSERT INTO emr.mrfmsetindx(
- instcd,
- itemindxseq,
- supitemindxseq,
- indxflag,
- indxnm,
- indxcnts,
- deptcd,
- userid,
- linkflag,
- linkcd,
- comnseq,
- fstrgstrid,
- fstrgstdt,
- lastupdtrid,
- lastupdtdt,
- jobkind,
- slipno
- )
- VALUES(
- #instcd#,
- EMR.SQ_MRFMSETINDX_01.NEXTVAL,
- 472,
- 'O',
- '',
- '',
- '',
- #userid#,
- 'Y',
- #formcd#,
- '',
- #userid#,
- systimestamp,
- #userid#,
- systimestamp,
- '',
- '')
- ]]>
- <!--<selectKey type="post" resultClass="System.Int32" property="itemindxseq">
- <![CDATA[SELECT EMR.SQ_MRFMSETINDX_01.CURRVAL AS itemindxseq FROM DUAL]]>
- </selectKey>-->
- </update>
- <!--<statement id="delUserFormSet" parameterClass="System.Collections.Hashtable">-->
- <update id="delUserFormSet" parameterClass="System.Collections.Hashtable">
- <![CDATA[
- update emr.mrfmsetindx
- set instcd = '999'
- where userid = #userid#
- and instcd = #instcd#
- and linkcd = #formcd#
- ]]>
- </update>
- <statement id="VERSION_INFO" parameterClass="System.Collections.Hashtable" resultMap="versionInfo">
- <![CDATA[
- SELECT VERSION_ORDER,
- MARKET_URL
- FROM MPLUS.MP_VERSION
- WHERE PLATFORM_TYPE = 'A'
- ]]>
- </statement>
- <statement id="getUserSignImage" parameterClass="System.Collections.Hashtable" resultMap="UserSignImageMap">
- <![CDATA[
- SELECT signdata
- FROM emr.mrfmsignimge
- WHERE userid = #userid#
- and repryn = 'Y'
- ]]>
- </statement>
- <statement id="GetUnfinishedListPerDoctor" parameterClass="System.Collections.Hashtable" resultMap="UnFinishedListMap">
- <![CDATA[
- select pid,
- (select ptbs.hngnm
- from pam.pmcmptbs ptbs
- where ptbs.pid = a.pid
- and ptbs.instcd = '111') as hngnm,
- (select v.FORM_CD
- from cmr.v_eform_formdoc v
- where v.FORM_RID = a.form_rid) as formcd,
- (select v.FORM_NAME
- from cmr.v_eform_formdoc v
- where v.FORM_RID = a.form_rid) as formnm,
- (select v.PRINT_ONLY
- from cmr.v_eform_formdoc v
- where v.FORM_RID = a.form_rid) as printonly,
- a.order_date as orderdate,
- (select s.cert_target
- from cmr.consent_image_sign s
- where s.consent_mst_rid = a.consent_mst_rid) as certtarget
- , a.consent_state as consentstate
- , a.consent_mst_rid as consentmstrid
- , a.cln_date as orddd
- , a.visit_type as ordtype
- , a.cln_dept_cd as orddeptcd
- , a.order_no as orderno
- , a.order_cd as ordercd
- , a.ocr_number as ocrnumber
- , a.cretno
- , a.create_user_name as createusername
- , a.form_rid as formrid
- , (select doc.form_guid from cmr.v_eform_formdoc doc where doc.form_rid = a.form_rid) as formguid
- from cmr.consent_mst a
- where a.modify_user_id = #userid#
- and a.hos_type = '111'
- and a.use_yn = 'Y'
- and substr(a.create_datetime, 1, 10) between
- to_char(to_date(#fromdd#, 'yyyymmdd'), 'yyyy-mm-dd') and
- to_char(to_date(#todd#, 'yyyymmdd'), 'yyyy-mm-dd')
- ]]>
- <isNotEqual property="status" compareValue="ALL">
- <![CDATA[
- and a.consent_state in ($status$)
- ]]>
- </isNotEqual>
- </statement>
- </statements>
- </sqlMap>
|