数据权限的修改
This commit is contained in:
+25
-13
@@ -8,18 +8,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<sql id="selectServiceItemsManagePo1">
|
||||
<where>
|
||||
del_flag = 1
|
||||
<!-- 删除标记:0-无状态,1-正常,2-已删除,查询时只查询正常的数据 -->
|
||||
<choose>
|
||||
<when test="delFlag != null">
|
||||
and del_flag = #{delFlag}
|
||||
</when>
|
||||
<otherwise>
|
||||
and del_flag = 1
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||
<!-- 如果 organizationId 和 topOrganizationId 都为 null,表示查询所有组织的数据(不添加组织过滤条件) -->
|
||||
<if test="organizationId != null">
|
||||
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
|
||||
and organization_id = #{organizationId}
|
||||
and organization_name IS NOT NULL
|
||||
and organization_name != ''
|
||||
and LENGTH(TRIM(organization_name)) > 0
|
||||
</if>
|
||||
<if test="topOrganizationId != null and organizationId == null">
|
||||
<!-- 如果设置了 topOrganizationId 但没有设置 organizationId,添加 top_organization_id 条件 -->
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
and organization_name IS NOT NULL
|
||||
and organization_name != ''
|
||||
and LENGTH(TRIM(organization_name)) > 0
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and organization_name like concat('%', #{organizationName}, '%')
|
||||
@@ -42,12 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
AND date_format(create_time,'%Y-%m-%d') <![CDATA[<=]]> #{createTimeEnd}
|
||||
</if>
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<if test="updateTimeStart != null and updateTimeStart != ''">
|
||||
AND date_format(update_time,'%Y-%m-%d') <![CDATA[>=]]> #{updateTimeStart}
|
||||
</if>
|
||||
@@ -63,10 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectServiceItemsManagePo1"/>
|
||||
</select>
|
||||
|
||||
<select id="selectServiceTypes"
|
||||
<select id="selectServiceTypes" parameterType="com.mhd.basic.domain.serviceItemsManage.repository.todo.ServiceItemsManageDO"
|
||||
resultType="com.mhd.basic.domain.serviceItemsManage.repository.po.ServiceItemsManagePO">
|
||||
select organization_name,service_items_code,service_items_name,tax_rate,CONCAT(service_items_name,service_items_code) cost_type
|
||||
from service_items_manage
|
||||
where del_flag = 1
|
||||
<include refid="selectServiceItemsManagePo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user