GroupDAO.xml 2.37 KB
Newer Older
罗绍泽 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
<?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.jw.app.business.group.GroupDAO">
    <select id="listAllModule" parameterType="map" resultType="upperCaseKeyMap">
<!-- 	select CONCAT('4_',t.m_id) as UUID, t.m_name as NAME, CONCAT('3_',t.mt_id) as PARENT_ID, case when count(f.GM)=0 then 0 else 1 end as auth from c_t_sys_module t  -->
<!-- 	left join c_t_sys_group_m f on f.m_id = t.m_id  -->
<!-- 	and f.g_id = #{G_ID}   -->
<!-- 	group by t.m_id, t.m_name, t.mt_id -->
		select CONCAT('4_',t.m_id) as UUID, t.m_name as NAME, CONCAT('3_',t.mt_id) as PARENT_ID, 
		case when count(f.GM)=0 then 0 else 1 end as chk,
		case when f.G_ID=#{G_ID} then 1 else 0 end as auth  
		from c_t_sys_module t 
		left join c_t_sys_group_m f on f.m_id = t.m_id 
		group by t.m_id, t.m_name, t.mt_id
	</select>
	
	<select id="listGroupModule" parameterType="map" resultType="upperCaseKeyMap">
	select * from c_t_sys_group_m  
	where 1=1
	and G_ID = #{G_ID}
	</select>
	
	<select id="listAllModuleType"  resultType="upperCaseKeyMap">
	select CONCAT('3_',t.mt_id) as UUID, t.mt_name as NAME, '0' as PARENT_ID from c_t_sys_module_type t
	</select>
	
	<select id="listAllUser" parameterType="map" resultType="upperCaseKeyMap">
	select CONCAT('2_',t.code) as UUID, t.emid as ID_NUMBER, CONCAT('1_',t.emdepart) as PARENT_ID, t.emname as NAME, case when count(f.gu)=0 then 0 else 1 end as auth from c_t_sys_loginuser t 
	left join c_t_sys_group_u f on f.u_id = t.code 
	and f.g_id = #{G_ID} 
	group by t.code, t.emid, t.emdepart, t.emname
	</select>
	
	<select id="listAllUserGLuser" parameterType="map" resultType="upperCaseKeyMap">
	select CONCAT('2_',t.code) as UUID, t.emid as ID_NUMBER, CONCAT('1_',t.emdepart) as PARENT_ID, t.emname as NAME, case when count(f.qxlx)=0 then 0 else 1 end as auth from c_t_sys_loginuser t 
	left join c_t_sys_person f on f.beiguanli = t.code 
	and f.guanli = #{CODE} and f.qxlx = #{QXLX}
	group by t.code, t.emid, t.emdepart, t.emname
	</select>
	
	<select id="listGroupUser" parameterType="map" resultType="upperCaseKeyMap">
	select * from c_t_sys_group_u 
	where 1=1
	and G_ID = #{G_ID}
	</select>
	
	<select id="listAllUnit" resultType="upperCaseKeyMap">
	select CONCAT('1_',t.dpt_no) as UUID, t.dpt_name as NAME, '0' as PARENT_ID from c_t_sys_department t 
	where 1=1
	</select>
</mapper>