CLIP.e-Form.Hospital.Dfh.User.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <sqlMap namespace="CLIP.e-Form.Consent.Dfh" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  3. <statements>
  4. <statement id="doLogin" parameterClass="System.Collections.Hashtable" resultMap="MobileLoginResultMap">
  5. <![CDATA[
  6. select usrb.usernm as usernm
  7. ,nvl(upwd.pwd, usrb.pwd) as pwd
  8. ,nvl(upwd.invalcnt,0) as invalcnt
  9. ,nvl(upwd.invalyn,'N') as invalyn
  10. ,nvl(upwd.invaldt,'-') as invaldt
  11. from (select userb.userid as userid
  12. ,userb.usernm as usernm
  13. ,userb.pwd as pwd
  14. from com.zsumusrb userb
  15. ,(select userid
  16. ,max(userfromdd) as userfromdd
  17. from com.zsumusrb
  18. where userid = #userid#
  19. group by userid) max_userb
  20. where userb.userid = max_userb.userid
  21. and userb.userfromdd = max_userb.userfromdd) usrb
  22. ,com.zsumupwd upwd
  23. where upwd.userid(+) = usrb.userid
  24. ]]>
  25. </statement>
  26. <statement id="getDeptListForConsent" parameterClass="System.Collections.Hashtable" resultMap="UserLoginDeptListResultMap">
  27. <![CDATA[
  28. SELECT EMPLNO,
  29. NAME,
  30. UNITCD,
  31. COM.FN_ZS_GETLATESTDEPTNM('111', UNITCD,TO_CHAR(SYSDATE,'YYYYMMDD')) UNITNM,
  32. decode(substr(COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD')), length(COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD'))) - 1),
  33. '외래', substr(DUTPLCEDEPTCD,1,6)||'0'||substr(DUTPLCEDEPTCD,8),DUTPLCEDEPTCD) as DUTPLCEDEPTCD,
  34. COM.FN_ZS_GETLATESTDEPTNM('111', DUTPLCEDEPTCD,TO_CHAR(SYSDATE,'YYYYMMDD')) DUTPLCEDEPTNM,
  35. JOBKINDCD,
  36. MIS.FN_RP_GETCOMCDNM('R0061', JOBKINDCD, TO_CHAR(SYSDATE,'YYYYMMDD')) JOBKINDNM,
  37. MOBILE,
  38. '' as MSG
  39. FROM MIS.RPBMEMPL
  40. WHERE EMPLNO = #userid#
  41. ]]>
  42. </statement>
  43. <statement id="GET_USER_INFO" parameterClass="System.Collections.Hashtable" resultMap="UserMap">
  44. <![CDATA[
  45. select a.userid,
  46. a.usernm,
  47. b.dutplcecd,
  48. dept.depthngnm,
  49. dept.deptengabbr,
  50. b.jobkindcd,
  51. (select cdnm
  52. from com.zbcmcode code
  53. where code.cdgrupid = 'R0061'
  54. and code.cdid = b.jobkindcd
  55. and code.valitodd = '99991231')
  56. from com.zsumusrb a,
  57. com.zsumusrd b,
  58. com.zsdddept dept
  59. where a.dutinstcd = '111'
  60. and a.dutinstcd = b.dutplceinstcd
  61. and a.userid = b.userid
  62. and a.usertodd = b.todd
  63. and dept.instcd = a.dutinstcd
  64. and dept.deptcd = b.dutplcecd
  65. and dept.valitodd = '99991231'
  66. and a.userfromdd <= to_char(to_date(sysdate),'YYYYMMDD')
  67. and a.usertodd >= to_char(to_date(sysdate),'YYYYMMDD')
  68. and b.userid = #userid#
  69. order by b.psnworkyn desc, b.fstrgstdt desc
  70. ]]>
  71. </statement>
  72. <!--
  73. <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
  74. <![CDATA[
  75. SELECT 'PERS_SET' AS SET_AUTH,
  76. 'bf159c4f-bb03-49ba-bc61-9d635f350c8d' AS FORM_GUID,
  77. '안와골절 정복술 설명 및 동의서' AS FORM_NAME,
  78. 109 AS FORM_RID,
  79. #userid# AS FORM_CD,
  80. 1 AS PRNTCNT
  81. FROM DUAL
  82. UNION ALL
  83. SELECT 'PERS_SET' AS SET_AUTH,
  84. '8095dad0-7318-4782-adfb-a2db2f0258e3' AS FORM_GUID,
  85. 'Safe Guard 사용 동의서' AS FORM_NAME,
  86. 110 AS FORM_RID,
  87. #userid# || '0000002' AS FORM_CD,
  88. 1 AS PRNTCNT
  89. FROM DUAL
  90. ]]>
  91. </statement>
  92. -->
  93. <statement id="getUserFormSet" parameterClass="System.Collections.Hashtable" resultMap="ConsentSetMap">
  94. <![CDATA[
  95. SELECT 'PERS_SET' AS SET_AUTH,
  96. a.linkcd AS FORM_CD,
  97. b.form_name as FORM_NAME,
  98. b.form_guid,
  99. b.FORM_RID,
  100. b.prntcnt,
  101. b.PRINT_ONLY,
  102. b.OCRTAGPRNTYN
  103. FROM emr.MRFMSETINDX a
  104. INNER JOIN cmr.v_eform_formdoc b
  105. ON a.LINKCD = b.FORM_CD
  106. WHERE a.userid = #userid#
  107. AND a.instcd = #instcd#
  108. and a.valiyn = 'Y'
  109. ORDER BY FORM_NAME
  110. ]]>
  111. </statement>
  112. <!--<statement id="setUserFormSet" parameterClass="System.Collections.Hashtable">-->
  113. <update id="setUserFormSet" parameterClass="System.Collections.Hashtable">
  114. <![CDATA[
  115. INSERT INTO emr.mrfmsetindx(
  116. instcd,
  117. itemindxseq,
  118. supitemindxseq,
  119. indxflag,
  120. indxnm,
  121. indxcnts,
  122. deptcd,
  123. userid,
  124. linkflag,
  125. linkcd,
  126. comnseq,
  127. fstrgstrid,
  128. fstrgstdt,
  129. lastupdtrid,
  130. lastupdtdt,
  131. jobkind,
  132. slipno
  133. )
  134. VALUES(
  135. #instcd#,
  136. EMR.SQ_MRFMSETINDX_01.NEXTVAL,
  137. 472,
  138. 'O',
  139. '',
  140. '',
  141. '',
  142. #userid#,
  143. 'Y',
  144. #formcd#,
  145. '',
  146. #userid#,
  147. systimestamp,
  148. #userid#,
  149. systimestamp,
  150. '',
  151. '')
  152. ]]>
  153. <!--<selectKey type="post" resultClass="System.Int32" property="itemindxseq">
  154. <![CDATA[SELECT EMR.SQ_MRFMSETINDX_01.CURRVAL AS itemindxseq FROM DUAL]]>
  155. </selectKey>-->
  156. </update>
  157. <!--<statement id="delUserFormSet" parameterClass="System.Collections.Hashtable">-->
  158. <update id="delUserFormSet" parameterClass="System.Collections.Hashtable">
  159. <![CDATA[
  160. update emr.mrfmsetindx
  161. set instcd = '999'
  162. where userid = #userid#
  163. and instcd = #instcd#
  164. and linkcd = #formcd#
  165. ]]>
  166. </update>
  167. <statement id="VERSION_INFO" parameterClass="System.Collections.Hashtable" resultMap="versionInfo">
  168. <![CDATA[
  169. SELECT VERSION_ORDER,
  170. MARKET_URL
  171. FROM MPLUS.MP_VERSION
  172. WHERE PLATFORM_TYPE = 'A'
  173. ]]>
  174. </statement>
  175. <statement id="getUserSignImage" parameterClass="System.Collections.Hashtable" resultMap="UserSignImageMap">
  176. <![CDATA[
  177. SELECT signdata
  178. FROM emr.mrfmsignimge
  179. WHERE userid = #userid#
  180. and repryn = 'Y'
  181. ]]>
  182. </statement>
  183. <statement id="GetUnfinishedListPerDoctor" parameterClass="System.Collections.Hashtable" resultMap="UnFinishedListMap">
  184. <![CDATA[
  185. select pid,
  186. (select ptbs.hngnm
  187. from pam.pmcmptbs ptbs
  188. where ptbs.pid = a.pid
  189. and ptbs.instcd = '111') as hngnm,
  190. (select v.FORM_CD
  191. from cmr.v_eform_formdoc v
  192. where v.FORM_RID = a.form_rid) as formcd,
  193. (select v.FORM_NAME
  194. from cmr.v_eform_formdoc v
  195. where v.FORM_RID = a.form_rid) as formnm,
  196. (select v.PRINT_ONLY
  197. from cmr.v_eform_formdoc v
  198. where v.FORM_RID = a.form_rid) as printonly,
  199. a.order_date as orderdate,
  200. (select s.cert_target
  201. from cmr.consent_image_sign s
  202. where s.consent_mst_rid = a.consent_mst_rid) as certtarget
  203. , a.consent_state as consentstate
  204. , a.consent_mst_rid as consentmstrid
  205. , a.cln_date as orddd
  206. , a.visit_type as ordtype
  207. , a.cln_dept_cd as orddeptcd
  208. , a.order_no as orderno
  209. , a.order_cd as ordercd
  210. , a.ocr_number as ocrnumber
  211. , a.cretno
  212. , a.create_user_name as createusername
  213. , a.form_rid as formrid
  214. , (select doc.form_guid from cmr.v_eform_formdoc doc where doc.form_rid = a.form_rid) as formguid
  215. from cmr.consent_mst a
  216. where a.modify_user_id = #userid#
  217. and a.hos_type = '111'
  218. and a.use_yn = 'Y'
  219. and substr(a.create_datetime, 1, 10) between
  220. to_char(to_date(#fromdd#, 'yyyymmdd'), 'yyyy-mm-dd') and
  221. to_char(to_date(#todd#, 'yyyymmdd'), 'yyyy-mm-dd')
  222. ]]>
  223. <isNotEqual property="status" compareValue="ALL">
  224. <![CDATA[
  225. and a.consent_state in ($status$)
  226. ]]>
  227. </isNotEqual>
  228. </statement>
  229. </statements>
  230. </sqlMap>