数据权限的修改
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
order by account_type,service_items_code,upper_subject_code,show_seq
|
||||
order by a.account_type,service_items_code,upper_subject_code,show_seq
|
||||
</select>
|
||||
<select id="selectCostSubject" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO"
|
||||
resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO">
|
||||
@@ -191,8 +191,24 @@
|
||||
<if test="expenseAccountDO.updateTimeEnd != null and expenseAccountDO.updateTimeEnd != ''">
|
||||
AND date_format(a.update_time,'%Y-%m-%d') <![CDATA[<=]]> #{expenseAccountDO.updateTimeEnd}
|
||||
</if>
|
||||
<if test="expenseAccountDO.topOrganizationId != null ">
|
||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||
<!-- 如果 organizationId 和 topOrganizationId 都为 null,表示查询所有组织的数据(不添加组织过滤条件) -->
|
||||
<if test="expenseAccountDO.organizationId != null">
|
||||
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
|
||||
and a.organization_id = #{expenseAccountDO.organizationId}
|
||||
and a.organization_name IS NOT NULL
|
||||
and a.organization_name != ''
|
||||
and LENGTH(TRIM(a.organization_name)) > 0
|
||||
</if>
|
||||
<if test="expenseAccountDO.topOrganizationId != null and expenseAccountDO.organizationId == null">
|
||||
<!-- 如果设置了 topOrganizationId 但没有设置 organizationId,添加 top_organization_id 条件 -->
|
||||
and a.top_organization_id = #{expenseAccountDO.topOrganizationId}
|
||||
and a.organization_name IS NOT NULL
|
||||
and a.organization_name != ''
|
||||
and LENGTH(TRIM(a.organization_name)) > 0
|
||||
</if>
|
||||
<if test="expenseAccountDO.organizationName != null and expenseAccountDO.organizationName != ''">
|
||||
and a.organization_name like concat('%', #{expenseAccountDO.organizationName}, '%')
|
||||
</if>
|
||||
<if test="expenseAccountDO.serviceItemsCode != null and expenseAccountDO.serviceItemsCode != ''">
|
||||
and b.service_items_code = #{expenseAccountDO.serviceItemsCode}
|
||||
|
||||
+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>
|
||||
|
||||
+7
@@ -9,6 +9,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.*
|
||||
from
|
||||
common_route a
|
||||
<if test="commonRouteDo.organizationId != null">
|
||||
LEFT JOIN "USER" u ON a.user_id = u.user_id AND u.del_flag = 0
|
||||
</if>
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
</sql>
|
||||
@@ -26,6 +29,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and (a.mail_name like concat('%', #{commonRouteDo.synthesize}, '%') OR a.mail_phone LIKE concat('%', #{commonRouteDo.synthesize}, '%') OR a.mail_address_plot LIKE concat('%', #{commonRouteDo.synthesize}, '%')
|
||||
OR a.addressee_name like concat('%', #{commonRouteDo.synthesize}, '%') OR a.addressee_phone LIKE concat('%', #{commonRouteDo.synthesize}, '%') OR a.addressee_address_plot LIKE concat('%', #{commonRouteDo.synthesize}, '%'))
|
||||
</if>
|
||||
<!-- 组织数据权限过滤:通过用户表关联来过滤组织数据 -->
|
||||
<if test="commonRouteDo.organizationId != null">
|
||||
and u.organization_id = #{commonRouteDo.organizationId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectCommonRouteByCommonRouteId" parameterType="java.lang.Long"
|
||||
|
||||
+28
-18
@@ -140,27 +140,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectAddressBookList" parameterType="com.mhd.common.core.domain.po.AddressBookPo" resultMap="AddressBookResult">
|
||||
<include refid="selectAddressBookVo"/>
|
||||
SELECT
|
||||
ab.*
|
||||
FROM
|
||||
address_book ab
|
||||
<if test="organizationId != null">
|
||||
LEFT JOIN "USER" u ON ab.user_id = u.user_id AND u.del_flag = 0
|
||||
</if>
|
||||
<where>
|
||||
del_flag = 1
|
||||
<if test="synthesize != null and synthesize != ''"> and (link_man like concat('%', #{synthesize}, '%') OR link_phone LIKE concat('%', #{synthesize}, '%') OR area_name LIKE concat('%', #{synthesize}, '%') OR address LIKE concat('%', #{synthesize}, '%') OR address_plot LIKE concat('%', #{synthesize}, '%')) </if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="linkMan != null and linkMan != ''"> and link_man = #{linkMan}</if>
|
||||
<if test="linkPhone != null and linkPhone != ''"> and link_phone = #{linkPhone}</if>
|
||||
<if test="provinceCode != null "> and province_code = #{provinceCode}</if>
|
||||
<if test="cityCode != null "> and city_code = #{cityCode}</if>
|
||||
<if test="countyCode != null "> and county_code = #{countyCode}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and province_name like concat('%', #{provinceName}, '%')</if>
|
||||
<if test="cityName != null and cityName != ''"> and city_name like concat('%', #{cityName}, '%')</if>
|
||||
<if test="countyName != null and countyName != ''"> and county_name like concat('%', #{countyName}, '%')</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="doorplate != null and doorplate != ''"> and doorplate = #{doorplate}</if>
|
||||
<if test="defaultStatus != null "> and default_status = #{defaultStatus}</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>
|
||||
ab.del_flag = 1
|
||||
<if test="synthesize != null and synthesize != ''"> and (ab.link_man like concat('%', #{synthesize}, '%') OR ab.link_phone LIKE concat('%', #{synthesize}, '%') OR ab.area_name LIKE concat('%', #{synthesize}, '%') OR ab.address LIKE concat('%', #{synthesize}, '%') OR ab.address_plot LIKE concat('%', #{synthesize}, '%')) </if>
|
||||
<if test="userId != null "> and ab.user_id = #{userId}</if>
|
||||
<if test="linkMan != null and linkMan != ''"> and ab.link_man = #{linkMan}</if>
|
||||
<if test="linkPhone != null and linkPhone != ''"> and ab.link_phone = #{linkPhone}</if>
|
||||
<if test="provinceCode != null "> and ab.province_code = #{provinceCode}</if>
|
||||
<if test="cityCode != null "> and ab.city_code = #{cityCode}</if>
|
||||
<if test="countyCode != null "> and ab.county_code = #{countyCode}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and ab.province_name like concat('%', #{provinceName}, '%')</if>
|
||||
<if test="cityName != null and cityName != ''"> and ab.city_name like concat('%', #{cityName}, '%')</if>
|
||||
<if test="countyName != null and countyName != ''"> and ab.county_name like concat('%', #{countyName}, '%')</if>
|
||||
<if test="address != null and address != ''"> and ab.address = #{address}</if>
|
||||
<if test="doorplate != null and doorplate != ''"> and ab.doorplate = #{doorplate}</if>
|
||||
<if test="defaultStatus != null "> and ab.default_status = #{defaultStatus}</if>
|
||||
<if test="createByName != null and createByName != ''"> and ab.create_by_name like concat('%', #{createByName}, '%')</if>
|
||||
<if test="updateByName != null and updateByName != ''"> and ab.update_by_name like concat('%', #{updateByName}, '%')</if>
|
||||
<!-- 组织数据权限过滤:通过用户表关联来过滤组织数据 -->
|
||||
<if test="organizationId != null">
|
||||
and u.organization_id = #{organizationId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
create_time DESC
|
||||
ab.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectAddressBookListByManifestId" parameterType="java.lang.Long" resultMap="AddressBookResult">
|
||||
|
||||
Reference in New Issue
Block a user