达梦适配修改

This commit is contained in:
王奎兴
2025-12-05 16:41:05 +08:00
parent 32f12bb138
commit 8ea6aa7e8f
14 changed files with 19 additions and 19 deletions
@@ -62,7 +62,7 @@
SELECT a.* FROM SELECT a.* FROM
(SELECT (SELECT
c.province_id as areaId, c.province_id as areaId,
"" as parentAreaCode, '' as parentAreaCode,
c.province_code AS areaCode, c.province_code AS areaCode,
c.province_code AS areaCodeNew, c.province_code AS areaCodeNew,
c.province_name AS areaName, c.province_name AS areaName,
@@ -134,7 +134,7 @@
resultType="com.mhd.basic.domain.areaAggregate.repository.po.SysAreaPO"> resultType="com.mhd.basic.domain.areaAggregate.repository.po.SysAreaPO">
SELECT SELECT
c.province_id as areaId, c.province_id as areaId,
"" as parentAreaCode, '' as parentAreaCode,
c.province_code AS areaCode, c.province_code AS areaCode,
c.province_code AS areaCodeNew, c.province_code AS areaCodeNew,
c.province_name AS areaName, c.province_name AS areaName,
@@ -56,6 +56,6 @@ public interface MotorcadeMapper extends BaseMapper<Motorcade>
List<UserDriverPo> fleetInviteDriverList(@Param("motorcadeDriverDO") MotorcadeDriverDO motorcadeDriverDO); List<UserDriverPo> fleetInviteDriverList(@Param("motorcadeDriverDO") MotorcadeDriverDO motorcadeDriverDO);
@Select("SELECT m.* FROM `motorcade_driver` md LEFT JOIN motorcade m ON md.motorcade_id = m.motorcade_id WHERE md.del_flag = 1 AND m.del_flag = 1 AND md.user_id = #{userId} AND m.motorcade_header_id != #{userId}") @Select("SELECT m.* FROM motorcade_driver md LEFT JOIN motorcade m ON md.motorcade_id = m.motorcade_id WHERE md.del_flag = 1 AND m.del_flag = 1 AND md.user_id = #{userId} AND m.motorcade_header_id != #{userId}")
List<MotorcadePo> getAllOtherMotorcade(@Param("userId") Long userId); List<MotorcadePo> getAllOtherMotorcade(@Param("userId") Long userId);
} }
@@ -37,6 +37,6 @@ public interface MotorcadeRecordMapper extends BaseMapper<MotorcadeRecord>
*/ */
List<MotorcadeRecordPo> invitationRecordListPC(@Param("motorcadeRecordDo")MotorcadeRecordDO motorcadeRecordDo); List<MotorcadeRecordPo> invitationRecordListPC(@Param("motorcadeRecordDo")MotorcadeRecordDO motorcadeRecordDo);
@Select("SELECT * FROM `motorcade_record` WHERE del_flag = 1 AND motorcade_id IN (SELECT motorcade_id FROM motorcade WHERE del_flag = 1 and motorcade_header_id = #{userId})") @Select("SELECT * FROM motorcade_record WHERE del_flag = 1 AND motorcade_id IN (SELECT motorcade_id FROM motorcade WHERE del_flag = 1 and motorcade_header_id = #{userId})")
List<MotorcadeRecord> getByMotorHeaderId(@Param("userId") Long userId); List<MotorcadeRecord> getByMotorHeaderId(@Param("userId") Long userId);
} }
@@ -12,7 +12,7 @@ import java.util.List;
public interface CustomAuthUserMapper extends BaseMapper<CustomAuthUserEntity> { public interface CustomAuthUserMapper extends BaseMapper<CustomAuthUserEntity> {
List<CustomAuthRoleOrUserPO> getCustomAuthByRoleOrUserId(CustomAuthDO customAuthDO); List<CustomAuthRoleOrUserPO> getCustomAuthByRoleOrUserId(CustomAuthDO customAuthDO);
@Select("SELECT * FROM `custom_auth_role` WHERE role_id IN (SELECT role_id FROM user_role WHERE user_id = #{userId})") @Select("SELECT * FROM custom_auth_role WHERE role_id IN (SELECT role_id FROM user_role WHERE user_id = #{userId})")
List<CustomAuthRoleOrUserPO> getCustomAuthByRole(@Param("userId") Long userId); List<CustomAuthRoleOrUserPO> getCustomAuthByRole(@Param("userId") Long userId);
void deleteCustomAuthUserByUserId(CustomAuthDO customAuthDO); void deleteCustomAuthUserByUserId(CustomAuthDO customAuthDO);
@@ -37,6 +37,6 @@ public interface DriverVehicleBindMapper extends BaseMapper<DriverVehicleBind>
*/ */
List<VehicleDriverBindAppPo> queryVehicleBindInfo(@Param("driverVehicleBindDo") DriverVehicleBindDo driverVehicleBindDo); List<VehicleDriverBindAppPo> queryVehicleBindInfo(@Param("driverVehicleBindDo") DriverVehicleBindDo driverVehicleBindDo);
@Select("SELECT count(driver_vehicle_bind_id) FROM `driver_vehicle_bind` WHERE (user_id = #{userId} OR driver_bind_id = #{userId}) AND del_flag = 1 ") @Select("SELECT count(driver_vehicle_bind_id) FROM driver_vehicle_bind WHERE (user_id = #{userId} OR driver_bind_id = #{userId}) AND del_flag = 1 ")
Integer selectByUserId(@Param("userId") Long userId); Integer selectByUserId(@Param("userId") Long userId);
} }
@@ -51,7 +51,7 @@ public interface UserMapper extends BaseMapper<UserEntity> {
List<UserDriverEnterprisePo> getAllDriverByOrganization(@Param("topOrganizationId") Long topOrganizationId); List<UserDriverEnterprisePo> getAllDriverByOrganization(@Param("topOrganizationId") Long topOrganizationId);
@Select("SELECT COUNT(*) FROM `user` WHERE del_flag = 1 AND create_by = #{userId} AND user_id != #{userId}") @Select("SELECT COUNT(*) FROM \"USER\" WHERE del_flag = 1 AND create_by = #{userId} AND user_id != #{userId}")
Integer selectCreatByUserId(@Param("userId") Long userId); Integer selectCreatByUserId(@Param("userId") Long userId);
@@ -64,7 +64,7 @@ public interface UserMapper extends BaseMapper<UserEntity> {
*/ */
List<UserAppPo> selectAppUserListByRoleCode(UserDO userDO); List<UserAppPo> selectAppUserListByRoleCode(UserDO userDO);
@Select("SELECT * FROM `user` WHERE del_flag = 1 AND organization_id = #{organizationId} AND user_account_type = 3 limit 1") @Select("SELECT * FROM \"USER\" WHERE del_flag = 1 AND organization_id = #{organizationId} AND user_account_type = 3 limit 1")
UserEntity selectByTopOrganizationId(@Param("organizationId") Long organizationId); UserEntity selectByTopOrganizationId(@Param("organizationId") Long organizationId);
@@ -335,7 +335,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join "USER" u on ud.user_id = u.user_id left join "USER" u on ud.user_id = u.user_id
LEFT JOIN (SELECT LEFT JOIN (SELECT
user_id, user_id,
WM_CONCAT( DISTINCT r.role_code SEPARATOR '&amp;' ) roleCode LISTAGG(DISTINCT r.role_code, '&amp;') WITHIN GROUP(ORDER BY r.role_code) AS roleCode
FROM FROM
role r role r
LEFT JOIN user_role ur ON r.role_id = ur.role_id LEFT JOIN user_role ur ON r.role_id = ur.role_id
@@ -167,7 +167,7 @@
<!-- 根据IDs合集查询角色名称 --> <!-- 根据IDs合集查询角色名称 -->
<select id="findRoleNameByRoleIds" parameterType="java.lang.Long" resultType="java.lang.String"> <select id="findRoleNameByRoleIds" parameterType="java.lang.Long" resultType="java.lang.String">
SELECT SELECT
WM_CONCAT( a.role_name SEPARATOR ';' ) AS roleName LISTAGG(DISTINCT a.role_name, ';') WITHIN GROUP(ORDER BY a.role_name) AS roleName
FROM FROM
role a role a
WHERE WHERE
@@ -193,7 +193,7 @@
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
user_id, user_id,
WM_CONCAT( DISTINCT r.role_name SEPARATOR '&amp;' ) roleName LISTAGG(DISTINCT r.role_name, '&amp;') WITHIN GROUP(ORDER BY r.role_name) AS roleName
FROM FROM
role r role r
LEFT JOIN user_role ur ON r.role_id = ur.role_id LEFT JOIN user_role ur ON r.role_id = ur.role_id
@@ -822,7 +822,7 @@
AND u.del_flag = 1 AND u.del_flag = 1
LEFT JOIN (SELECT LEFT JOIN (SELECT
user_id, user_id,
WM_CONCAT( DISTINCT r.role_code SEPARATOR '&amp;' ) roleCode LISTAGG(DISTINCT r.role_code, '&amp;') WITHIN GROUP(ORDER BY r.role_code) AS roleCode
FROM FROM
role r role r
LEFT JOIN user_role ur ON r.role_id = ur.role_id LEFT JOIN user_role ur ON r.role_id = ur.role_id
@@ -716,7 +716,7 @@
SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name SELECT u.user_id, u.user_name, u.user_area_address, u.user_area_county_id, u.user_area_name ,u.user_phone,u.has_default_address,b.shipper_id,b.shipper_enterprise_name
FROM "USER" u FROM "USER" u
LEFT JOIN user_shipper b ON u.user_id = b.user_id LEFT JOIN user_shipper b ON u.user_id = b.user_id
left join (select user_id, WM_CONCAT(r.role_name separator '&amp;') roleName left join (select user_id, LISTAGG(r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName
from role r from role r
left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1 left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1
where r.del_flag = 1 where r.del_flag = 1
@@ -142,7 +142,7 @@
b.freight_node b.freight_node
FROM "USER" a FROM "USER" a
LEFT JOIN user_shipper b ON a.user_id = b.user_id LEFT JOIN user_shipper b ON a.user_id = b.user_id
left join (select user_id, WM_CONCAT(r.role_name separator '&amp;') roleName left join (select user_id, LISTAGG(DISTINCT r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName
from role r from role r
left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1 left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1
where r.del_flag = 1 where r.del_flag = 1
@@ -152,6 +152,6 @@ public interface MenuMapper extends BaseMapper<Menu> {
List<Menu> selectListByProductIdList(@Param("list") List<Long> list); List<Menu> selectListByProductIdList(@Param("list") List<Long> list);
@Select("SELECT * FROM `custom_auth` WHERE menu_id in (SELECT menu_id FROM sys_menu WHERE top_organization_id = #{organizationId})") @Select("SELECT * FROM custom_auth WHERE menu_id in (SELECT menu_id FROM sys_menu WHERE top_organization_id = #{organizationId})")
List<CustomAuth> getCustomAuthByOrganizationId(@Param("organizationId") Long organizationId); List<CustomAuth> getCustomAuthByOrganizationId(@Param("organizationId") Long organizationId);
} }
@@ -281,7 +281,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
del_flag = 1 del_flag = 1
and menu_show = 1 and menu_show = 1
AND menu_component IS NOT NULL AND menu_component IS NOT NULL
AND menu_component != "" AND menu_component != ''
</select> </select>
<select id="selectMenuById" parameterType="java.lang.Long" resultMap="MenuResult"> <select id="selectMenuById" parameterType="java.lang.Long" resultMap="MenuResult">
@@ -33,12 +33,12 @@
i.material_id, i.material_id,
m.category AS material_category, m.category AS material_category,
m.name AS material_name, m.name AS material_name,
m.model AS material_model, m."MODEL" AS material_model,
i.quantity, i.quantity,
m.unit, m.unit,
m.weight, m.weight,
m.code_managed, m.code_managed,
m.value, m."VALUE",
i.machine_serial_no, i.machine_serial_no,
i.created_at i.created_at
FROM FROM
@@ -91,7 +91,7 @@
i.material_id, i.material_id,
m.category AS material_category, m.category AS material_category,
m.name AS material_name, m.name AS material_name,
m.model AS material_model, m."MODEL" AS material_model,
i.quantity, i.quantity,
m.unit, m.unit,
m.weight, m.weight,