<select id= "i0203f0004sql001"
Parametertype= "com.dsunsoft.cqhzz.sql.dto.I0203.I0203F0004SQL001DbcIU001"
Resulttype= "com.dsunsoft.cqhzz.sql.dto.I0203.I0203F0004SQL001DbcOU001" >
SELECT
T1. user_id as UserId,
T1. User_nm as USERNM,
T2. Emp_nm as EMPNM,
T1. PWD as PWD,
T1.tel as TEL,
T1. E_Mail as EMail,
T1. We_chat as WeChat,
T1. emp_id as EmpId,
T1. Created_by as CreatedBy,
T1. Created_date as CreatedDate,
T1. Last_modified_by as Lastmodifiedby,
T1. Last_modified_date as LastModifiedDate,
T1.is_del as Isdel,
T1. AVATAR as AVATAR,
T3.rolenms as Rolenms,
T4.rvsegnms as Rvsegnms,
T5. Addvnm as ADDVNM,
T5. Addvcd_path as Addvcdpath,
T5. Addvnm_path as Addvnmpath
From
Tb_wr_sys_user T1
Left JOIN
Tb_wr_sys_emp T2 on T1. emp_id = t2. emp_id
Left JOIN
(SELECT T11. USER_ID,
Listagg (t21. ROLE_NM, ', ') within GROUP (ORDER by T11. ROLE_ID) as Rolenms
From Tb_wr_sys_user_role T11,tb_wr_sys_role t21
WHERE T11. role_id = t21. role_id
GROUP by T11. USER_ID) t3 on T1. user_id = T3. user_id
Left JOIN
(SELECT T11. emp_id,
Listagg (t21. RV_SEG_NM, ', ') within GROUP (ORDER by T21. Order_index) as Rvsegnms
From Tb_wr_rps_emp t11,tb_wr_rv_seg t21
WHERE T11. rv_seg_id = t21. rv_seg_id
GROUP by T11. emp_id) T4 on T1. emp_id = T4. emp_id
Left JOIN
Tb_addv_b T5 on T2. ADDVCD = T5. Addvcd
<where>
(T1.is_del = 0 OR T1.is_del is NULL)
<if test= "UserId! = null" >
and T1. user_id = #{userid, Jdbctype=varchar}
</if>
<if test= "USERNM! = null and USERNM! =" ">
and T1. User_nm like '%${usernm}% '
</if>
<if test= "EmpId! = null and EmpId! =" ">
and T1. emp_id = #{empid, Jdbctype=varchar}
</if>
<IF test= "Tel! = NULL and Tel! =" ">
and T1.tel = #{tel, Jdbctype=varchar}
</if>
<if test= "Addvcdpath! = null and Addvcdpath! =" ">
and T5. Addvcd_path like '%${addvcdpath}% '
</if>
</where>
</select>
About Oracle merge fields