Update pom.xml for MyBatis Plus integration and downgrade Spring Boot version; refactor validation imports from Jakarta to Javax; modify mappers to extend BaseMapper for CRUD operations; clean up unused MyBatis-Flex mappers; adjust application.yml for MyBatis Plus configuration.

This commit is contained in:
zyh
2025-08-26 15:37:52 +08:00
parent bd0a9e6dd7
commit 833159d1f1
31 changed files with 204 additions and 104 deletions

View File

@@ -12,11 +12,18 @@ spring:
minimum-idle: 2
connection-timeout: 30000
mybatis:
mybatis-plus:
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: com.gameplatform.server.model
type-aliases-package: com.gameplatform.server.model.entity
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: auto
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
server:
port: 18080
@@ -31,7 +38,7 @@ logging:
level:
root: info
com.gameplatform.server: debug
org.mybatis: debug
com.baomidou.mybatisplus: debug
org.apache.ibatis: debug
com.zaxxer.hikari: info

View File

@@ -27,26 +27,7 @@
LIMIT 1
</select>
<select id="findById" parameterType="long" resultMap="UserAccountMap">
SELECT id, user_type, username, password_hash, status, points_balance, created_at, updated_at
FROM user_account
WHERE id = #{id}
LIMIT 1
</select>
<insert id="insert" parameterType="com.gameplatform.server.model.entity.account.UserAccount" useGeneratedKeys="true" keyProperty="id">
INSERT INTO user_account (user_type, username, password_hash, status, points_balance)
VALUES (#{userType}, #{username}, #{passwordHash}, #{status}, #{pointsBalance})
</insert>
<update id="update" parameterType="com.gameplatform.server.model.entity.account.UserAccount">
UPDATE user_account
<set>
<if test="status != null">status = #{status},</if>
<if test="pointsBalance != null">points_balance = #{pointsBalance},</if>
</set>
WHERE id = #{id}
</update>
<update id="setStatus">
UPDATE user_account SET status = #{status} WHERE id = #{id}