<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "权限基础信息维护">
<query id = "FrmBelong.doQueryRole" desc = "获取所有角色名">
SELECT T.NAME,T.ID FROM CORE_APP_SROLE T ORDER BY T.ID ASC
</query>
<query id = "FrmBelong.doQueryRoleData" desc = "查询指定角色是否启用数据权限">
<![CDATA[
SELECT * FROM YDM_BS_PURVIEW_M T WHERE T.ROLEID || '&' LIKE '%' || ? || '%'
]]>
</query>
<query id = "FrmBelong.selectYdmBsPu" desc = "查询是否角色名已存在">
SELECT COUNT(1)ACOUNT FROM YDM_BS_PURVIEW_M T WHERE T.ROLEID = ?
</query>
<query id = "FrmBelong.addYdmBsPu" desc = "新增角色启用所属权权限">
 INSERT INTO YDM_BS_PURVIEW_M(
        ROLEID,
        IS_BELONG_PURVIEW,
        MEMO,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME)
 VALUES( 
        '#ROLEID#',
        '#IS_BELONG_PURVIEW#',
        '#MEMO#',
        '1',
        '#CREATE_NAME#',
        SYSDATE,
        '#UPDATE_NAME#',
        '',
        '#DELETE_NAME#',
        '')
</query>
<query id = "FrmBelong.updateYdmBsPu" desc = "修改所属权是否启用信息">
 UPDATE YDM_BS_PURVIEW_M T
   SET 
        T.IS_BELONG_PURVIEW = '#IS_BELONG_PURVIEW#',
        T.UPDATE_NAME = '#UPDATE_NAME#',
        T.MEMO = '#MEMO#'
 WHERE
T.ROLEID = '#ROLEID#'
</query>
<query id = "FrmBelong.doQueryDepart" desc = "获取所有科室、部门">
SELECT T.DEPARTNAME,T.DEPARTID FROM CORE_APP_DEPARTMENT T ORDER BY T.DEPARTID ASC
</query>
<query id = "FrmBelong.doQueryBelong" desc = "查询产线所属权">
SELECT DISTINCT T.DEPARTMENT_DESC AS BELONG_NAME,T.DEPARTMENT_CODE AS BELONG_CODE FROM COM_BASE_PLINE T WHERE T.VALIDFLAG = '1' ORDER BY T.DEPARTMENT_CODE ASC
</query>
<query id = "FrmBelong.doQueryDepartIdData" desc = "科室、部门对应所属权查询">
<![CDATA[
SELECT * FROM YDM_BS_PURVIEW_D T WHERE T.DEPART_ID || '&' LIKE '%' || ? || '%'
]]>
</query>
<query id = "FrmBelong.selectYdmBsPuD" desc = "查询科室、部门对应所属权">
SELECT COUNT(1)ACOUNT FROM YDM_BS_PURVIEW_D T WHERE T.DEPART_ID = ? AND T.BELONG_ID = ? 
</query>
<query id = "FrmBelong.addYdmBsPuD" desc = "新增科室部门对应所属权">
 INSERT INTO YDM_BS_PURVIEW_D(
        DEPART_ID,
        BELONG_ID,
        MEMO,
        VALIDFLAG,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME)
 VALUES( 
        '#DEPART_ID#',
        '#BELONG_ID#',
        '#MEMO#',
        '1',
        '#CREATE_NAME#',
        SYSDATE,
        '',
        '',
        '',
        '')
</query>
<query id = "FrmBelong.deleteYdmBsPu" desc = "删除">
DELETE FROM YDM_BS_PURVIEW_D T WHERE T.DEPART_ID = '#DEPART_ID#' AND T.BELONG_ID = '#BELONG_ID#'
</query>
</queryMap>