diff --git a/db/800pjcloudx_wallet.sql b/db/800pjcloudx_wallet.sql index 6b7fed1b6..aeb003c47 100644 --- a/db/800pjcloudx_wallet.sql +++ b/db/800pjcloudx_wallet.sql @@ -67,15 +67,15 @@ CREATE INDEX idx_dept_id ON mch_manage (dept_id); DROP TABLE IF EXISTS `mch_dept`; CREATE TABLE mch_dept ( - id bigint NOT NULL COMMENT '主键', - mch_id bigint NOT NULL COMMENT '商户id', - dept_id bigint NOT NULL COMMENT '部门id', - create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', - create_time datetime DEFAULT NULL COMMENT '创建时间', - update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', - update_time datetime DEFAULT NULL COMMENT '修改时间', - del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记', - tenant_id bigint DEFAULT NULL COMMENT '租户ID', + id BIGINT(19) not null comment '主键', + mch_id BIGINT(19) not null comment '商户id', + dept_id BIGINT(19) not null comment '部门id', + create_by VARCHAR(64) null comment '创建人', + create_time DATETIME null comment '创建时间', + update_by VARCHAR(64) null comment '修改人', + update_time DATETIME null comment '修改时间', + del_flag CHAR default '0' null comment '删除标记', + tenant_id BIGINT(19) null comment '租户ID', PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 @@ -117,10 +117,10 @@ CREATE INDEX idx_dept_id ON wallet_manage (user_id); DROP TABLE IF EXISTS mch_rule_price_config; CREATE TABLE mch_rule_price_config ( - id bigint NOT NULL COMMENT '主键', - rule_price_type varchar(64) NOT NULL COMMENT '规则类型', - base_price bigint NOT NULL COMMENT '基础金额', - multiple bigint NOT NULL COMMENT '额外支付的倍数', + id BIGINT(19) not null comment '主键', + rule_price_type VARCHAR(64) not null comment '规则类型', + base_price BIGINT(19) not null comment '基础金额', + multiple BIGINT(19) not null comment '额外支付的倍数', create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', create_time datetime DEFAULT NULL COMMENT '创建时间', update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', @@ -137,11 +137,12 @@ CREATE TABLE mch_rule_price_config DROP TABLE IF EXISTS mch_rule_join; CREATE TABLE mch_rule_join ( - id bigint NOT NULL COMMENT '主键', - source_mch_id bigint NOT NULL COMMENT '源商户id', - target_mch_id bigint NOT NULL COMMENT '目标商户id', - target_dept_id bigint NOT NULL COMMENT '目标部门id', - rule_price_config_id bigint NOT NULL COMMENT '规则配置id', + id BIGINT(19) not null comment '主键', + source_mch_id BIGINT(19) not null comment '源商户id', + target_mch_id BIGINT(19) not null comment '目标商户id', + target_dept_id BIGINT(19) not null comment '目标部门id', + rule_price_config_id BIGINT(19) not null comment '规则配置id', + status VARCHAR(64) default '0' not null comment '是否启用', create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', create_time datetime DEFAULT NULL COMMENT '创建时间', update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/mch/MchRuleJoinDtoEntity.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/mch/MchRuleJoinDtoEntity.java index 4533b42ff..5104caaa2 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/mch/MchRuleJoinDtoEntity.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/mch/MchRuleJoinDtoEntity.java @@ -47,6 +47,12 @@ public class MchRuleJoinDtoEntity extends Model { @Schema(description = "规则配置id") private Long rulePriceConfigId; + /** + * 是否启用 + */ + @Schema(description = "是否启用") + private String status; + /** * 创建人 */ diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/MchManageMapper.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/MchManageMapper.java index 14d6c4da2..69ed9ab43 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/MchManageMapper.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/MchManageMapper.java @@ -25,6 +25,7 @@ public interface MchManageMapper extends PjcloudBaseMapper { .selectAll(MchManageEntity.class) .eqIfExists(MchManageEntity::getVisibleMobile, dto.getVisibleMobile()) .eqIfExists(MchManageEntity::getParentId, dto.getParentId()) + .eq(dto.getParentIsNull(), MchManageEntity::getParentId, -1L) .likeIfExists(MchManageEntity::getName, dto.getName()) .in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds()) .apply(ObjectUtil.isNotEmpty(dto.getType()), "FIND_IN_SET({0}, types)", dto.getType()) diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/mch/MchRuleJoinMapper.xml b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/mch/MchRuleJoinMapper.xml index cfc6b0b22..fcb5df564 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/mch/MchRuleJoinMapper.xml +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/mch/MchRuleJoinMapper.xml @@ -8,6 +8,7 @@ + @@ -21,6 +22,7 @@ a.source_mch_id, a.target_mch_id, a.rule_price_config_id, + a.status, a.create_by, a.create_time, a.update_by, @@ -76,5 +78,4 @@ a.id = #{id} - \ No newline at end of file