zhuyifan

农信点餐小程序

Showing 39 changed files with 1006 additions and 39 deletions
...@@ -6,13 +6,12 @@ ...@@ -6,13 +6,12 @@
6 */ 6 */
7 7
8 plugins { 8 plugins {
9 - // Apply the application plugin to add support for building a CLI application in Java.
10 id 'java' 9 id 'java'
11 id 'idea' 10 id 'idea'
12 id 'application' 11 id 'application'
13 - id 'org.springframework.boot' version '2.3.3.RELEASE' 12 + id 'org.springframework.boot' version '2.5.12'
14 - id 'io.spring.dependency-management' version '1.0.10.RELEASE' 13 + id 'io.spring.dependency-management' version '1.1.6'
15 - id 'com.google.protobuf' version '0.9.3' 14 + id 'com.google.protobuf' version '0.9.4'
16 } 15 }
17 16
18 repositories { 17 repositories {
...@@ -29,8 +28,8 @@ application { ...@@ -29,8 +28,8 @@ application {
29 } 28 }
30 29
31 ext { 30 ext {
32 - grpcVersion = '1.39.0' 31 + grpcVersion = '1.62.2'
33 - protobufVersion = '3.17.2' 32 + protobufVersion = '3.25.3'
34 } 33 }
35 34
36 dependencies { 35 dependencies {
...@@ -55,20 +54,13 @@ dependencies { ...@@ -55,20 +54,13 @@ dependencies {
55 testImplementation "io.grpc:grpc-testing:${grpcVersion}" 54 testImplementation "io.grpc:grpc-testing:${grpcVersion}"
56 } 55 }
57 56
58 -static def isAppleSilicon() {
59 - // 检测 macOS 并且使用的是 Apple Silicon 架构
60 - return System.getProperty('os.name').toLowerCase().contains('mac') && System.getProperty('os.arch').equals('aarch64')
61 -}
62 -
63 -def protocPlatform = isAppleSilicon() ? ':osx-x86_64' : '';
64 -
65 protobuf { 57 protobuf {
66 protoc { 58 protoc {
67 - artifact = "com.google.protobuf:protoc:${protobufVersion}${protocPlatform}" 59 + artifact = "com.google.protobuf:protoc:${protobufVersion}"
68 } 60 }
69 plugins { 61 plugins {
70 grpc { 62 grpc {
71 - artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}${protocPlatform}" 63 + artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
72 } 64 }
73 } 65 }
74 generateProtoTasks { 66 generateProtoTasks {
...@@ -87,6 +79,13 @@ tasks.withType(JavaCompile).configureEach { ...@@ -87,6 +79,13 @@ tasks.withType(JavaCompile).configureEach {
87 it.options.fork = true 79 it.options.fork = true
88 } 80 }
89 81
82 +tasks {
83 + compileJava {
84 + dependsOn generateProto
85 + source fileTree('build/generated/source/proto/main/java')
86 + }
87 +}
88 +
90 sourceSets { 89 sourceSets {
91 main { 90 main {
92 java { 91 java {
......
1 org.gradle.daemon=true 1 org.gradle.daemon=true
2 org.gradle.parallel=true 2 org.gradle.parallel=true
3 org.gradle.caching=true 3 org.gradle.caching=true
4 -org.gradle.jvmargs=-Xmx4096m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 4 +org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
5 +org.gradle.incremental=true
5 org.gradle.configureondemand=true 6 org.gradle.configureondemand=true
6 -org.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64
...\ No newline at end of file ...\ No newline at end of file
7 +org.gradle.configuration-cache=true
...\ No newline at end of file ...\ No newline at end of file
......
1 distributionBase=GRADLE_USER_HOME 1 distributionBase=GRADLE_USER_HOME
2 distributionPath=wrapper/dists 2 distributionPath=wrapper/dists
3 -distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-6.9-bin.zip 3 +distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.11-bin.zip
4 networkTimeout=10000 4 networkTimeout=10000
5 zipStoreBase=GRADLE_USER_HOME 5 zipStoreBase=GRADLE_USER_HOME
6 zipStorePath=wrapper/dists 6 zipStorePath=wrapper/dists
7 +#org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,6 +9,7 @@ import brave.propagation.B3Propagation; ...@@ -9,6 +9,7 @@ import brave.propagation.B3Propagation;
9 import brave.propagation.CurrentTraceContext; 9 import brave.propagation.CurrentTraceContext;
10 import brave.propagation.TraceContext; 10 import brave.propagation.TraceContext;
11 import brave.sampler.Sampler; 11 import brave.sampler.Sampler;
12 +import com.tianting.infoloop.service.grpc.MealOrderGrpcService;
12 import com.tianting.infoloop.service.grpc.OrderGrpcService; 13 import com.tianting.infoloop.service.grpc.OrderGrpcService;
13 import io.grpc.Server; 14 import io.grpc.Server;
14 import io.grpc.ServerInterceptor; 15 import io.grpc.ServerInterceptor;
...@@ -64,10 +65,12 @@ public class AppConfig implements ApplicationContextAware { ...@@ -64,10 +65,12 @@ public class AppConfig implements ApplicationContextAware {
64 @Bean 65 @Bean
65 public Server serviceServer(@Value(SERVICE_PORT) final int port, 66 public Server serviceServer(@Value(SERVICE_PORT) final int port,
66 final ServerInterceptor serverInterceptor, 67 final ServerInterceptor serverInterceptor,
67 - final OrderGrpcService orderGrpcService) { 68 + final OrderGrpcService orderGrpcService,
69 + final MealOrderGrpcService mealOrderGrpcService) {
68 return NettyServerBuilder 70 return NettyServerBuilder
69 .forPort(port) 71 .forPort(port)
70 .addService(ServerInterceptors.intercept(orderGrpcService, serverInterceptor)) 72 .addService(ServerInterceptors.intercept(orderGrpcService, serverInterceptor))
73 + .addService(ServerInterceptors.intercept(mealOrderGrpcService, serverInterceptor))
71 .build(); 74 .build();
72 } 75 }
73 } 76 }
......
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.Diner;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【diners(就餐人表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.Diner
11 +*/
12 +public interface DinerMapper extends MyBaseMapper<Diner> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.GradeClass;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【grade_classes(年级班级表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.GradeClass
11 +*/
12 +public interface GradeClassMapper extends MyBaseMapper<GradeClass> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.MealMenuRecord;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【meal_menu_records(餐单记录表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.MealMenuRecord
11 +*/
12 +public interface MealMenuRecordMapper extends MyBaseMapper<MealMenuRecord> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.MealOrder;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【meal_orders(订餐记录表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.MealOrder
11 +*/
12 +public interface MealOrderMapper extends MyBaseMapper<MealOrder> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.MpAccountDinerRef;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【mp_account_diner_refs(小程序账号和就餐人关联表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.MpAccountDinerRef
11 +*/
12 +public interface MpAccountDinerRefMapper extends MyBaseMapper<MpAccountDinerRef> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.mapper;
2 +
3 +import com.tianting.infoloop.inject.MyBaseMapper;
4 +import com.tianting.infoloop.model.db.MpAccount;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【mp_accounts(小程序账号表)】的数据库操作Mapper
9 +* @createDate 2025-04-10 13:22:20
10 +* @Entity com.tianting.infoloop.model.db.MpAccount
11 +*/
12 +public interface MpAccountMapper extends MyBaseMapper<MpAccount> {
13 +
14 +}
15 +
16 +
17 +
18 +
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableLogic;
8 +import com.baomidou.mybatisplus.annotation.TableName;
9 +import com.baomidou.mybatisplus.extension.activerecord.Model;
10 +import lombok.Data;
11 +import lombok.EqualsAndHashCode;
12 +import lombok.experimental.Accessors;
13 +
14 +import java.io.Serializable;
15 +import java.time.LocalDateTime;
16 +
17 +/**
18 + * @TableName diners
19 + */
20 +@Data
21 +@Accessors(chain = true)
22 +@EqualsAndHashCode(callSuper = true)
23 +@TableName(value ="diners")
24 +public class Diner extends Model<Diner> implements Serializable {
25 +
26 + @TableId(type = IdType.AUTO)
27 + private Integer id;
28 +
29 + private Integer enterpriseId;
30 +
31 + private Integer clientId;
32 +
33 + private Integer classId;
34 +
35 + private String studentNo;
36 +
37 + private String name;
38 +
39 + private Integer createdBy;
40 +
41 + @TableField(fill = FieldFill.INSERT)
42 + private LocalDateTime createdAt;
43 +
44 + private Integer creationSource;
45 +
46 + private Integer updatedBy;
47 +
48 + @TableField(fill = FieldFill.INSERT_UPDATE)
49 + private LocalDateTime updatedAt;
50 +
51 + private Integer updateSource;
52 +
53 + @TableLogic
54 + private Boolean isDeleted;
55 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableName;
8 +import com.baomidou.mybatisplus.extension.activerecord.Model;
9 +import lombok.Data;
10 +import lombok.EqualsAndHashCode;
11 +import lombok.experimental.Accessors;
12 +
13 +import java.io.Serializable;
14 +import java.time.LocalDateTime;
15 +
16 +/**
17 + * @TableName grade_classes
18 + */
19 +@Data
20 +@Accessors(chain = true)
21 +@EqualsAndHashCode(callSuper = true)
22 +@TableName(value ="grade_classes")
23 +public class GradeClass extends Model<GradeClass> implements Serializable {
24 +
25 + @TableId(type = IdType.AUTO)
26 + private Integer id;
27 +
28 + private Integer enterpriseId;
29 +
30 + private Integer clientId;
31 +
32 + private String gradeName;
33 +
34 + private String className;
35 +
36 + private String fullName;
37 +
38 + private Integer createdBy;
39 +
40 + @TableField(fill = FieldFill.INSERT)
41 + private LocalDateTime createdAt;
42 +
43 + private Integer creationSource;
44 +
45 + private Integer updatedBy;
46 +
47 + @TableField(fill = FieldFill.INSERT_UPDATE)
48 + private LocalDateTime updatedAt;
49 +
50 + private Integer updateSource;
51 +
52 + private Boolean isDeleted;
53 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableName;
8 +import com.baomidou.mybatisplus.extension.activerecord.Model;
9 +import lombok.Data;
10 +import lombok.EqualsAndHashCode;
11 +import lombok.experimental.Accessors;
12 +
13 +import java.io.Serializable;
14 +import java.time.LocalDateTime;
15 +
16 +/**
17 + * @TableName meal_menu_records
18 + */
19 +@Data
20 +@Accessors(chain = true)
21 +@EqualsAndHashCode(callSuper = true)
22 +@TableName(value ="meal_menu_records")
23 +public class MealMenuRecord extends Model<MealMenuRecord> implements Serializable {
24 +
25 + @TableId(type = IdType.AUTO)
26 + private Integer id;
27 +
28 + private Integer enterpriseId;
29 +
30 + private Integer clientId;
31 +
32 + private String name;
33 +
34 + private String imageUrl;
35 +
36 + private Integer createdBy;
37 +
38 + @TableField(fill = FieldFill.INSERT)
39 + private LocalDateTime createdAt;
40 +
41 + private Integer creationSource;
42 +
43 + private Integer updatedBy;
44 +
45 + @TableField(fill = FieldFill.INSERT_UPDATE)
46 + private LocalDateTime updatedAt;
47 +
48 + private Integer updateSource;
49 +
50 + private Boolean isDeleted;
51 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableName;
8 +import com.baomidou.mybatisplus.extension.activerecord.Model;
9 +import lombok.Data;
10 +import lombok.EqualsAndHashCode;
11 +import lombok.experimental.Accessors;
12 +
13 +import java.io.Serializable;
14 +import java.time.LocalDateTime;
15 +
16 +/**
17 + * @TableName meal_orders
18 + */
19 +@Data
20 +@Accessors(chain = true)
21 +@EqualsAndHashCode(callSuper = true)
22 +@TableName(value ="meal_orders")
23 +public class MealOrder extends Model<MealOrder> implements Serializable {
24 +
25 + @TableId(type = IdType.AUTO)
26 + private Integer id;
27 +
28 + private Integer enterpriseId;
29 +
30 + private Integer clientId;
31 +
32 + private Integer menuId;
33 +
34 + private Integer accountId;
35 +
36 + private Integer orderMethod;
37 +
38 + private Integer dinerId;
39 +
40 + private String dinerName;
41 +
42 + private String clientName;
43 +
44 + private String gradeName;
45 +
46 + private String className;
47 +
48 + private String studentNo;
49 +
50 + private LocalDateTime reserveDate;
51 +
52 + private String meals;
53 +
54 + private Integer createdBy;
55 +
56 + @TableField(fill = FieldFill.INSERT)
57 + private LocalDateTime createdAt;
58 +
59 + private Integer creationSource;
60 +
61 + private Integer updatedBy;
62 +
63 + @TableField(fill = FieldFill.INSERT_UPDATE)
64 + private LocalDateTime updatedAt;
65 +
66 + private Integer updateSource;
67 +
68 + private Boolean isDeleted;
69 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableName;
8 +import com.baomidou.mybatisplus.extension.activerecord.Model;
9 +import lombok.Data;
10 +import lombok.EqualsAndHashCode;
11 +import lombok.experimental.Accessors;
12 +
13 +import java.io.Serializable;
14 +import java.time.LocalDateTime;
15 +
16 +/**
17 + * @TableName mp_accounts
18 + */
19 +@Data
20 +@Accessors(chain = true)
21 +@EqualsAndHashCode(callSuper = true)
22 +@TableName(value ="mp_accounts")
23 +public class MpAccount extends Model<MpAccount> implements Serializable {
24 +
25 + @TableId(type = IdType.AUTO)
26 + private Integer id;
27 +
28 + private Integer enterpriseId;
29 +
30 + private String openId;
31 +
32 + private String unionId;
33 +
34 + private String nickname;
35 +
36 + private String avatarUrl;
37 +
38 + private Integer gender;
39 +
40 + private String phoneNumber;
41 +
42 + private Integer status;
43 +
44 + private Integer createdBy;
45 +
46 + @TableField(fill = FieldFill.INSERT)
47 + private LocalDateTime createdAt;
48 +
49 + private Integer creationSource;
50 +
51 + private Integer updatedBy;
52 +
53 + @TableField(fill = FieldFill.INSERT_UPDATE)
54 + private LocalDateTime updatedAt;
55 +
56 + private Integer updateSource;
57 +
58 + private Boolean isDeleted;
59 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.model.db;
2 +
3 +import com.baomidou.mybatisplus.annotation.FieldFill;
4 +import com.baomidou.mybatisplus.annotation.IdType;
5 +import com.baomidou.mybatisplus.annotation.TableField;
6 +import com.baomidou.mybatisplus.annotation.TableId;
7 +import com.baomidou.mybatisplus.annotation.TableName;
8 +import com.baomidou.mybatisplus.extension.activerecord.Model;
9 +import lombok.Data;
10 +import lombok.EqualsAndHashCode;
11 +import lombok.experimental.Accessors;
12 +
13 +import java.io.Serializable;
14 +import java.time.LocalDateTime;
15 +
16 +/**
17 + * @TableName mp_account_diner_refs
18 + */
19 +@Data
20 +@Accessors(chain = true)
21 +@EqualsAndHashCode(callSuper = true)
22 +@TableName(value ="mp_account_diner_refs")
23 +public class MpAccountDinerRef extends Model<MpAccountDinerRef> implements Serializable {
24 +
25 + @TableId(type = IdType.AUTO)
26 + private Integer id;
27 +
28 + private Integer enterpriseId;
29 +
30 + private Integer accountId;
31 +
32 + private Integer dinerId;
33 +
34 + private Integer createdBy;
35 +
36 + @TableField(fill = FieldFill.INSERT)
37 + private LocalDateTime createdAt;
38 +
39 + private Integer creationSource;
40 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.Diner;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【diners(就餐人表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface DinerService extends IService<Diner> {
12 +
13 +}
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.GradeClass;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【grade_classes(年级班级表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface GradeClassService extends IService<GradeClass> {
12 +
13 +}
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.MealMenuRecord;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【meal_menu_records(餐单记录表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface MealMenuRecordService extends IService<MealMenuRecord> {
12 +
13 +}
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.MealOrder;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【meal_orders(订餐记录表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface MealOrderService extends IService<MealOrder> {
12 +
13 +}
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.MpAccountDinerRef;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【mp_account_diner_refs(小程序账号和就餐人关联表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface MpAccountDinerRefService extends IService<MpAccountDinerRef> {
12 +
13 +}
1 +package com.tianting.infoloop.service;
2 +
3 +import com.baomidou.mybatisplus.extension.service.IService;
4 +import com.tianting.infoloop.model.db.MpAccount;
5 +
6 +/**
7 +* @author zhuyf
8 +* @description 针对表【mp_accounts(小程序账号表)】的数据库操作Service
9 +* @createDate 2025-04-10 13:22:20
10 +*/
11 +public interface MpAccountService extends IService<MpAccount> {
12 +
13 +}
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.DinerMapper;
5 +import com.tianting.infoloop.model.db.Diner;
6 +import com.tianting.infoloop.service.DinerService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【diners(就餐人表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class DinerServiceImpl extends ServiceImpl<DinerMapper, Diner>
16 + implements DinerService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.GradeClassMapper;
5 +import com.tianting.infoloop.model.db.GradeClass;
6 +import com.tianting.infoloop.service.GradeClassService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【grade_classes(年级班级表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class GradeClassServiceImpl extends ServiceImpl<GradeClassMapper, GradeClass>
16 + implements GradeClassService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.MealMenuRecordMapper;
5 +import com.tianting.infoloop.model.db.MealMenuRecord;
6 +import com.tianting.infoloop.service.MealMenuRecordService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【meal_menu_records(餐单记录表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class MealMenuRecordServiceImpl extends ServiceImpl<MealMenuRecordMapper, MealMenuRecord>
16 + implements MealMenuRecordService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.MealOrderMapper;
5 +import com.tianting.infoloop.model.db.MealOrder;
6 +import com.tianting.infoloop.service.MealOrderService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【meal_orders(订餐记录表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class MealOrderServiceImpl extends ServiceImpl<MealOrderMapper, MealOrder>
16 + implements MealOrderService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.MpAccountDinerRefMapper;
5 +import com.tianting.infoloop.model.db.MpAccountDinerRef;
6 +import com.tianting.infoloop.service.MpAccountDinerRefService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【mp_account_diner_refs(小程序账号和就餐人关联表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class MpAccountDinerRefServiceImpl extends ServiceImpl<MpAccountDinerRefMapper, MpAccountDinerRef>
16 + implements MpAccountDinerRefService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.service.impl;
2 +
3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4 +import com.tianting.infoloop.mapper.MpAccountMapper;
5 +import com.tianting.infoloop.model.db.MpAccount;
6 +import com.tianting.infoloop.service.MpAccountService;
7 +import org.springframework.stereotype.Service;
8 +
9 +/**
10 +* @author zhuyf
11 +* @description 针对表【mp_accounts(小程序账号表)】的数据库操作Service实现
12 +* @createDate 2025-04-10 13:22:20
13 +*/
14 +@Service
15 +public class MpAccountServiceImpl extends ServiceImpl<MpAccountMapper, MpAccount>
16 + implements MpAccountService{
17 +
18 +}
19 +
20 +
21 +
22 +
1 +package com.tianting.infoloop.utils;
2 +
3 +import com.fasterxml.jackson.annotation.JsonInclude;
4 +import com.fasterxml.jackson.core.JsonProcessingException;
5 +import com.fasterxml.jackson.core.type.TypeReference;
6 +import com.fasterxml.jackson.databind.DeserializationFeature;
7 +import com.fasterxml.jackson.databind.JsonNode;
8 +import com.fasterxml.jackson.databind.ObjectMapper;
9 +import com.fasterxml.jackson.databind.module.SimpleModule;
10 +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
11 +
12 +import java.io.IOException;
13 +import java.util.List;
14 +
15 +public final class JSONUtil {
16 + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
17 +
18 + static {
19 + final SimpleModule module = new SimpleModule();
20 + module.addSerializer(Long.class, ToStringSerializer.instance);
21 + module.addSerializer(long.class, ToStringSerializer.instance);
22 + OBJECT_MAPPER.registerModule(module);
23 + // 如果json中有新增的字段并且是实体类类中不存在的,不报错
24 + OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
25 + // 序列化时忽略值为null的属性
26 + OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL);
27 + }
28 +
29 + public static String writeAsJson(final Object object) {
30 + try {
31 + return OBJECT_MAPPER.writeValueAsString(object);
32 + } catch (final JsonProcessingException e) {
33 + throw new RuntimeException(e);
34 + }
35 + }
36 +
37 + public static <T> T readJsonAs(final String json, final Class<T> clazz) {
38 + try {
39 + return OBJECT_MAPPER.readerFor(clazz).readValue(json);
40 + } catch (final IOException e) {
41 + throw new RuntimeException(e);
42 + }
43 + }
44 +
45 + public static <T> List<T> readJsonAsList(String jsonString, Class<T> clazz) {
46 + try {
47 + return OBJECT_MAPPER.readValue(jsonString, new TypeReference<>() {
48 + });
49 + } catch (Exception e) {
50 + throw new RuntimeException("Failed to convert JSON to List<" + clazz.getSimpleName() + ">", e);
51 + }
52 + }
53 +
54 + public static <T> JsonNode readTree(final String json) {
55 + try {
56 + return OBJECT_MAPPER.readTree(json);
57 + } catch (final IOException e) {
58 + throw new RuntimeException(e);
59 + }
60 + }
61 + private JSONUtil() {}
62 +}
1 package com.tianting.infoloop.utils; 1 package com.tianting.infoloop.utils;
2 2
3 import cn.hutool.core.date.LocalDateTimeUtil; 3 import cn.hutool.core.date.LocalDateTimeUtil;
4 +import com.fasterxml.jackson.databind.JsonNode;
5 +import com.fasterxml.jackson.databind.ObjectMapper;
6 +import com.fasterxml.jackson.databind.node.ObjectNode;
4 import com.google.gson.Gson; 7 import com.google.gson.Gson;
5 import com.google.gson.GsonBuilder; 8 import com.google.gson.GsonBuilder;
9 +import com.google.gson.JsonArray;
10 +import com.google.gson.JsonElement;
11 +import com.google.gson.JsonParser;
6 import com.google.gson.TypeAdapter; 12 import com.google.gson.TypeAdapter;
7 import com.google.gson.stream.JsonReader; 13 import com.google.gson.stream.JsonReader;
8 import com.google.gson.stream.JsonWriter; 14 import com.google.gson.stream.JsonWriter;
...@@ -23,6 +29,8 @@ import java.util.List; ...@@ -23,6 +29,8 @@ import java.util.List;
23 29
24 public class ProtoBeanUtil { 30 public class ProtoBeanUtil {
25 31
32 + private static Gson gson = getGson();
33 +
26 /** 34 /**
27 * protoBean -> string 35 * protoBean -> string
28 * 36 *
...@@ -31,13 +39,68 @@ public class ProtoBeanUtil { ...@@ -31,13 +39,68 @@ public class ProtoBeanUtil {
31 */ 39 */
32 public static String protoToJson(MessageOrBuilder sourceMessage) { 40 public static String protoToJson(MessageOrBuilder sourceMessage) {
33 try { 41 try {
34 - return JsonFormat.printer().print(sourceMessage); 42 + return JsonFormat.printer().includingDefaultValueFields().print(sourceMessage);
35 } catch (Exception e) { 43 } catch (Exception e) {
36 throw new IllegalArgumentException("ProtoBeanUtil->toJson->errorMessage:proto序列化string异常", e); 44 throw new IllegalArgumentException("ProtoBeanUtil->toJson->errorMessage:proto序列化string异常", e);
37 } 45 }
38 } 46 }
39 47
40 - private static Gson gson = getGson(); 48 + @SuppressWarnings("unchecked")
49 + public static <T extends Message> T jsonToProto(String json, Class<T> protoBean) {
50 + try {
51 + Constructor<T> declaredConstructor = protoBean.getDeclaredConstructor((Class<?>[]) null);
52 + declaredConstructor.setAccessible(Boolean.TRUE);
53 + T instance = declaredConstructor.newInstance();
54 + final var builder = instance.toBuilder();
55 + if (json == null || json.isEmpty() || json.trim().equals("{}")) {
56 + return (T) builder.build();
57 + }
58 + JsonFormat.parser().ignoringUnknownFields().merge(json, builder);
59 + return (T) builder.build();
60 + } catch (Exception e) {
61 + throw new IllegalArgumentException("json to proto error", e);
62 + }
63 + }
64 +
65 + @SuppressWarnings("unchecked")
66 + public static <T extends Message> List<T> jsonToProtoList(String jsonArray, Class<T> protoBean) {
67 + try {
68 + if (jsonArray == null || jsonArray.isEmpty() || jsonArray.trim().equals("[]")) {
69 + return new ArrayList<>();
70 + }
71 + Constructor<T> declaredConstructor = protoBean.getDeclaredConstructor();
72 + declaredConstructor.setAccessible(true);
73 + List<T> protoList = new ArrayList<>();
74 + JsonArray jsonElements = JsonParser.parseString(jsonArray).getAsJsonArray();
75 + for (JsonElement jsonElement : jsonElements) {
76 + T instance = declaredConstructor.newInstance();
77 + Message.Builder builder = instance.toBuilder();
78 + JsonFormat.parser().ignoringUnknownFields().merge(jsonElement.toString(), builder);
79 + protoList.add((T) builder.build());
80 + }
81 + return protoList;
82 + } catch (Exception e) {
83 + throw new IllegalArgumentException("jsonArray to protoList error", e);
84 + }
85 + }
86 +
87 + public static String protoListToJson(List<? extends Message> sourceList) {
88 + try {
89 + StringBuilder jsonArrayBuilder = new StringBuilder();
90 + jsonArrayBuilder.append("[");
91 + for (int i = 0; i < sourceList.size(); i++) {
92 + String json = protoToJson(sourceList.get(i));
93 + jsonArrayBuilder.append(json);
94 + if (i < sourceList.size() - 1) {
95 + jsonArrayBuilder.append(",");
96 + }
97 + }
98 + jsonArrayBuilder.append("]");
99 + return jsonArrayBuilder.toString();
100 + } catch (Exception e) {
101 + throw new IllegalArgumentException("ProtoList to jsonArray error", e);
102 + }
103 + }
41 104
42 /** 105 /**
43 * @desc: String 转 Builder对象 106 * @desc: String 转 Builder对象
...@@ -53,7 +116,7 @@ public class ProtoBeanUtil { ...@@ -53,7 +116,7 @@ public class ProtoBeanUtil {
53 /** 116 /**
54 * @desc: JavaBean 转 Builder对象 117 * @desc: JavaBean 转 Builder对象
55 */ 118 */
56 - private static <M extends Message.Builder, T> M beanToBuilder(T beanSource, Class<M> targetBuilderClass) { 119 + private static <M extends Message.Builder, T> M beanToBuilder(T beanSource, Class<M> targetBuilderClass, String... ignoreFields) {
57 try { 120 try {
58 Constructor<M> declaredConstructor = targetBuilderClass.getDeclaredConstructor((Class<?>[]) null); 121 Constructor<M> declaredConstructor = targetBuilderClass.getDeclaredConstructor((Class<?>[]) null);
59 122
...@@ -65,8 +128,15 @@ public class ProtoBeanUtil { ...@@ -65,8 +128,15 @@ public class ProtoBeanUtil {
65 128
66 String json = gson.toJson(beanSource); 129 String json = gson.toJson(beanSource);
67 130
68 - jsonToBuilder(instance, json); 131 + ObjectMapper mapper = new ObjectMapper();
69 - 132 + JsonNode root = mapper.readTree(json);
133 + if (root instanceof ObjectNode objNode) {
134 + for (String field : ignoreFields) {
135 + objNode.remove(field);
136 + }
137 + }
138 + String filteredJson = mapper.writeValueAsString(root);
139 + jsonToBuilder(instance, filteredJson);
70 return instance; 140 return instance;
71 } catch (Exception e) { 141 } catch (Exception e) {
72 throw new IllegalArgumentException("ProtoBeanUtil->beanToBuilder->errorMessage:JavaBean 转 Builder对象异常", e); 142 throw new IllegalArgumentException("ProtoBeanUtil->beanToBuilder->errorMessage:JavaBean 转 Builder对象异常", e);
...@@ -78,7 +148,7 @@ public class ProtoBeanUtil { ...@@ -78,7 +148,7 @@ public class ProtoBeanUtil {
78 */ 148 */
79 @SneakyThrows 149 @SneakyThrows
80 @SuppressWarnings("unchecked") 150 @SuppressWarnings("unchecked")
81 - public static <M extends Message, T> M beanToProto(T bean, Class<M> targetProtoClass) { 151 + public static <M extends Message, T> M beanToProto(T bean, Class<M> targetProtoClass, String... ignoreFields) {
82 152
83 Constructor<M> declaredConstructor = targetProtoClass.getDeclaredConstructor((Class<?>[]) null); 153 Constructor<M> declaredConstructor = targetProtoClass.getDeclaredConstructor((Class<?>[]) null);
84 154
...@@ -92,7 +162,16 @@ public class ProtoBeanUtil { ...@@ -92,7 +162,16 @@ public class ProtoBeanUtil {
92 162
93 Message.Builder builder = instance.toBuilder(); 163 Message.Builder builder = instance.toBuilder();
94 164
95 - jsonToBuilder(builder, json); 165 + ObjectMapper mapper = new ObjectMapper();
166 + JsonNode root = mapper.readTree(json);
167 + if (root instanceof ObjectNode objNode) {
168 + for (String field : ignoreFields) {
169 + objNode.remove(field);
170 + }
171 + }
172 +
173 + String filteredJson = mapper.writeValueAsString(root);
174 + jsonToBuilder(builder, filteredJson);
96 175
97 return (M) builder.build(); 176 return (M) builder.build();
98 } 177 }
...@@ -101,7 +180,7 @@ public class ProtoBeanUtil { ...@@ -101,7 +180,7 @@ public class ProtoBeanUtil {
101 * @desc: javaBean 列表 转 ProtoBean 列表 180 * @desc: javaBean 列表 转 ProtoBean 列表
102 */ 181 */
103 @SuppressWarnings("unchecked") 182 @SuppressWarnings("unchecked")
104 - public static <M, T extends Message> List<T> beanListToProtoList(Collection<M> beanSourceList, Class<T> protoBean) { 183 + public static <M, T extends Message> List<T> beanListToProtoList(Collection<M> beanSourceList, Class<T> protoBean, String... ignoreFields) {
105 try { 184 try {
106 List<T> resultList = new ArrayList<>(); 185 List<T> resultList = new ArrayList<>();
107 for (Object bean : beanSourceList) { 186 for (Object bean : beanSourceList) {
...@@ -114,7 +193,7 @@ public class ProtoBeanUtil { ...@@ -114,7 +193,7 @@ public class ProtoBeanUtil {
114 193
115 Class<? extends Message.Builder> aClass = instance.toBuilder().getClass(); 194 Class<? extends Message.Builder> aClass = instance.toBuilder().getClass();
116 195
117 - Message.Builder builder = beanToBuilder(bean, aClass); 196 + Message.Builder builder = beanToBuilder(bean, aClass, ignoreFields);
118 197
119 resultList.add((T) builder.build()); 198 resultList.add((T) builder.build());
120 } 199 }
......
This diff is collapsed. Click to expand it.
...@@ -7,20 +7,13 @@ spring.main.web-application-type=none ...@@ -7,20 +7,13 @@ spring.main.web-application-type=none
7 spring.application.name=order-service 7 spring.application.name=order-service
8 spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 spring.datasource.driver-class-name=com.mysql.jdbc.Driver
9 9
10 -spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:3306/cater?autoReconnect=true&tcpKeepAlive=true&rewriteBatchedStatements=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false 10 +spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:3306/test?autoReconnect=true&tcpKeepAlive=true&rewriteBatchedStatements=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false
11 spring.datasource.dynamic.datasource.master.username=root 11 spring.datasource.dynamic.datasource.master.username=root
12 -spring.datasource.dynamic.datasource.master.password=QAZwsx098 12 +spring.datasource.dynamic.datasource.master.password=123456
13 -spring.datasource.dynamic.datasource.slave.url=jdbc:mysql://localhost:3306/cater_slave?autoReconnect=true&tcpKeepAlive=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false 13 +spring.datasource.dynamic.datasource.slave.url=jdbc:mysql://localhost:3306/test?autoReconnect=true&tcpKeepAlive=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false
14 spring.datasource.dynamic.datasource.slave.username=root 14 spring.datasource.dynamic.datasource.slave.username=root
15 -spring.datasource.dynamic.datasource.slave.password=QAZwsx098 15 +spring.datasource.dynamic.datasource.slave.password=123456
16 spring.datasource.dynamic.primary=master 16 spring.datasource.dynamic.primary=master
17 -#spring.datasource.dynamic.datasource.master.url=jdbc:mysql://rm-uf63gfjzejp163e3g4o.mysql.rds.aliyuncs.com:3306/qingniu?autoReconnect=true&tcpKeepAlive=true&rewriteBatchedStatements=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false
18 -#spring.datasource.dynamic.datasource.master.username=jj_infoloop_stage
19 -#spring.datasource.dynamic.datasource.master.password=H8kjNeChi1wimXw
20 -#spring.datasource.dynamic.datasource.slave.url=jdbc:mysql://rm-uf63gfjzejp163e3g4o.mysql.rds.aliyuncs.com:3306/qingniu?autoReconnect=true&tcpKeepAlive=true&statementInterceptors=com.tianting.infoloop.tracing.MysqlZipkinInterceptor&useSSL=false
21 -#spring.datasource.dynamic.datasource.slave.username=jj_infoloop_stage
22 -#spring.datasource.dynamic.datasource.slave.password=H8kjNeChi1wimXw
23 -#spring.datasource.dynamic.primary=master
24 17
25 logging.config=classpath:logback-spring.xml 18 logging.config=classpath:logback-spring.xml
26 19
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.DinerMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.Diner">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="clientId" column="clientId" jdbcType="INTEGER"/>
11 + <result property="classId" column="classId" jdbcType="INTEGER"/>
12 + <result property="studentNo" column="studentNo" jdbcType="VARCHAR"/>
13 + <result property="name" column="name" jdbcType="VARCHAR"/>
14 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
15 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
16 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
17 + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/>
18 + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/>
19 + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/>
20 + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/>
21 + </resultMap>
22 +
23 + <sql id="Base_Column_List">
24 + id,enterpriseId,clientId,
25 + classId,studentNo,name,
26 + createdBy,createdAt,creationSource,
27 + updatedBy,updatedAt,updateSource,
28 + isDeleted
29 + </sql>
30 +</mapper>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.GradeClassMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.GradeClass">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="clientId" column="clientId" jdbcType="INTEGER"/>
11 + <result property="gradeName" column="gradeName" jdbcType="VARCHAR"/>
12 + <result property="className" column="className" jdbcType="VARCHAR"/>
13 + <result property="fullName" column="fullName" jdbcType="VARCHAR"/>
14 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
15 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
16 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
17 + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/>
18 + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/>
19 + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/>
20 + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/>
21 + </resultMap>
22 +
23 + <sql id="Base_Column_List">
24 + id,enterpriseId,clientId,
25 + gradeName,className,fullName,
26 + createdBy,createdAt,creationSource,
27 + updatedBy,updatedAt,updateSource,
28 + isDeleted
29 + </sql>
30 +</mapper>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.MealMenuRecordMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.MealMenuRecord">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="clientId" column="clientId" jdbcType="INTEGER"/>
11 + <result property="name" column="name" jdbcType="VARCHAR"/>
12 + <result property="imageUrl" column="imageUrl" jdbcType="VARCHAR"/>
13 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
14 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
15 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
16 + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/>
17 + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/>
18 + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/>
19 + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/>
20 + </resultMap>
21 +
22 + <sql id="Base_Column_List">
23 + id,enterpriseId,clientId,
24 + name,imageUrl,createdBy,
25 + createdAt,creationSource,updatedBy,
26 + updatedAt,updateSource,isDeleted
27 + </sql>
28 +</mapper>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.MealOrderMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.MealOrder">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="clientId" column="clientId" jdbcType="INTEGER"/>
11 + <result property="menuId" column="menuId" jdbcType="INTEGER"/>
12 + <result property="accountId" column="accountId" jdbcType="INTEGER"/>
13 + <result property="orderMethod" column="orderMethod" jdbcType="TINYINT"/>
14 + <result property="dinerId" column="dinerId" jdbcType="INTEGER"/>
15 + <result property="dinerName" column="dinerName" jdbcType="VARCHAR"/>
16 + <result property="clientName" column="clientName" jdbcType="VARCHAR"/>
17 + <result property="gradeName" column="gradeName" jdbcType="VARCHAR"/>
18 + <result property="className" column="className" jdbcType="VARCHAR"/>
19 + <result property="studentNo" column="studentNo" jdbcType="VARCHAR"/>
20 + <result property="reserveDate" column="reserveDate" jdbcType="TIMESTAMP"/>
21 + <result property="meals" column="meals" jdbcType="OTHER"/>
22 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
23 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
24 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
25 + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/>
26 + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/>
27 + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/>
28 + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/>
29 + </resultMap>
30 +
31 + <sql id="Base_Column_List">
32 + id,enterpriseId,clientId,
33 + menuId,accountId,orderMethod,
34 + dinerId,dinerName,clientName,
35 + gradeName,className,studentNo,
36 + reserveDate,meals,createdBy,
37 + createdAt,creationSource,updatedBy,
38 + updatedAt,updateSource,isDeleted
39 + </sql>
40 +</mapper>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.MpAccountDinerRefMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.MpAccountDinerRef">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="accountId" column="accountId" jdbcType="INTEGER"/>
11 + <result property="dinerId" column="dinerId" jdbcType="INTEGER"/>
12 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
13 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
14 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
15 + </resultMap>
16 +
17 + <sql id="Base_Column_List">
18 + id,enterpriseId,accountId,
19 + dinerId,createdBy,createdAt,
20 + creationSource
21 + </sql>
22 +</mapper>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE mapper
3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 +<mapper namespace="com.tianting.infoloop.mapper.MpAccountMapper">
6 +
7 + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.MpAccount">
8 + <id property="id" column="id" jdbcType="INTEGER"/>
9 + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/>
10 + <result property="openId" column="openId" jdbcType="VARCHAR"/>
11 + <result property="unionId" column="unionId" jdbcType="VARCHAR"/>
12 + <result property="nickname" column="nickname" jdbcType="VARCHAR"/>
13 + <result property="avatarUrl" column="avatarUrl" jdbcType="VARCHAR"/>
14 + <result property="gender" column="gender" jdbcType="TINYINT"/>
15 + <result property="phoneNumber" column="phoneNumber" jdbcType="VARCHAR"/>
16 + <result property="status" column="status" jdbcType="TINYINT"/>
17 + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/>
18 + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/>
19 + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/>
20 + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/>
21 + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/>
22 + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/>
23 + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/>
24 + </resultMap>
25 +
26 + <sql id="Base_Column_List">
27 + id,enterpriseId,openId,
28 + unionId,nickname,avatarUrl,
29 + gender,phoneNumber,status,
30 + createdBy,createdAt,creationSource,
31 + updatedBy,updatedAt,updateSource,
32 + isDeleted
33 + </sql>
34 +</mapper>