and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%')))
and
(
<choose>
<whentest="regionCode != null and regionCode != ''">--按监管单位统计时,省局使用
(
<choose>
<whentest="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
bi.supervise_org_code != '50' AND bi.supervise_org_code = #{orgCode}
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
)
OR
(bi.supervise_org_code = '50' AND bi.office_region LIKE CONCAT('%', #{regionCode}, '%'))
</when>
<otherwise>--按监管单位统计时,除省局外使用
<choose>
<whentest="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
bi.supervise_org_code != '50' AND bi.supervise_org_code = #{orgCode}
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
((a.supervise_org_code != '50' and a.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (a.supervise_org_code = '50' and a.office_region LIKE CONCAT ('%', #{cityCode}, '%')))
(
and a.is_delete = '0'
<choose>
<whentest="cityCode != null and cityCode != ''">--按监管单位统计时,省局使用
(
<choose>
<whentest="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
a.supervise_org_code != '50' AND a.supervise_org_code = #{orgCode}
</when>
<otherwise>
a.supervise_org_code != '50' AND a.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
)
OR
(a.supervise_org_code = '50' AND a.office_region LIKE CONCAT('%', #{cityCode}, '%'))
</when>
<otherwise>--按监管单位统计时,除省局使用
<choose>
<whentest="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
a.supervise_org_code != '50' AND a.supervise_org_code = #{orgCode}
</when>
<otherwise>
a.supervise_org_code != '50' AND a.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%')))
AND (
and tui.is_delete=false
<choose>
<whentest="regionCode != null and regionCode != ''">
(bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%'))
OR
(bi.supervise_org_code = '50' AND bi.office_region LIKE CONCAT('%', #{regionCode}, '%'))
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')