<commit_before><#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
<#assign ArrayUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.ArrayUtils"]>
<#assign ObjectUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.ObjectUtils"]>
<#assign SecurityUtils = beansWrapperFn.getStaticModels()["org.apache.shiro.SecurityUtils"]>

<#macro permissionSql prefixName = true role="administrator" permission="*:view:*"  permission_departments="" departmentColumnName="t.DEPARTMENT_CODE" permission_users="" userColumnName="t.personal_code" permissions="" permissionColumnName="t.personal_code">
    <#if permission_departments == "*" || permission_users == "*"|| permissions == "*" || SecurityUtils.getSubject().hasRole(role)|| SecurityUtils.getSubject().isPermitted(permission)>
        <#return >
    </#if>

    <#if cardone.StringUtils.isNotBlank(permission_departments) || cardone.StringUtils.isNotBlank(permission_users) || cardone.StringUtils.isNotBlank(permission)>
        ${prefixName?string('WHERE (', 'AND (')}
        <#assign andOrPrefixName = true>
        <#if cardone.StringUtils.isNotBlank(permission_departments)>
        ${andOrPrefixName?string('', ' or ')}${departmentColumnName} = ANY(string_to_array(:permission_departments, ','))
            <#assign andOrPrefixName = false>
        </#if>
        <#if cardone.StringUtils.isNotBlank(permission_users)>
        ${andOrPrefixName?string('', ' or ')}${userColumnName} = ANY(string_to_array(:permission_users, ','))
            <#assign andOrPrefixName = false>
        </#if>
        <#if cardone.StringUtils.isNotBlank(permission)>
        ${andOrPrefixName?string('', ' or ')}${permissionColumnName} = ANY(string_to_array(:permissions, ','))
            <#assign andOrPrefixName = false>
        </#if>
    )
    </#if>
</#macro><commit_msg>查询权限控制<commit_after><#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
<#assign ArrayUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.ArrayUtils"]>
<#assign ObjectUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.ObjectUtils"]>
<#assign SecurityUtils = beansWrapperFn.getStaticModels()["org.apache.shiro.SecurityUtils"]>

<#macro permissionSql prefixName = true permission_departments="" departmentColumnName="t.DEPARTMENT_CODE" permission_users="" userColumnName="t.personal_code" permissions="" permissionColumnName="t.personal_code">
    <#if permission_departments == "*" || permission_users == "*"|| permissions == "*">
        <#return >
    </#if>

    <#if cardone.StringUtils.isNotBlank(permission_departments) || cardone.StringUtils.isNotBlank(permission_users) || cardone.StringUtils.isNotBlank(permission)>
        ${prefixName?string('WHERE (', 'AND (')}
        <#assign andOrPrefixName = true>
        <#if cardone.StringUtils.isNotBlank(permission_departments)>
        ${andOrPrefixName?string('', ' or ')}${departmentColumnName} = ANY(string_to_array(:permission_departments, ','))
            <#assign andOrPrefixName = false>
        </#if>
        <#if cardone.StringUtils.isNotBlank(permission_users)>
        ${andOrPrefixName?string('', ' or ')}${userColumnName} = ANY(string_to_array(:permission_users, ','))
            <#assign andOrPrefixName = false>
        </#if>
        <#if cardone.StringUtils.isNotBlank(permissions)>
        ${andOrPrefixName?string('', ' or ')}${permissionColumnName} = ANY(string_to_array(:permissions, ','))
            <#assign andOrPrefixName = false>
        </#if>
    )
    </#if>
</#macro>
{'fraction_non_alphanumeric': 0.16117418997507615, 'fraction_numerical': 0.001661589587371919, 'mean_word_length': 5.050251256281407, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2895668', 'n_tokens_mistral': 1113, 'n_tokens_neox': 1087, 'n_words': 141}