合并代码
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.88.14:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
@@ -0,0 +1,5 @@
|
||||
##################### 业务模块 #####################
|
||||
## MobileCodeService
|
||||
modules.mobile-code-service.code-expire-time-millis = 600000
|
||||
modules.mobile-code-service.send-maximum-quantity-per-day = 10
|
||||
modules.mobile-code-service.send-frequency = 60000
|
||||
@@ -0,0 +1,44 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://180.167.213.26:13306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
|
||||
# mybatis-plus
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: auto
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
mapperLocations: classpath*:mapper/*.xml
|
||||
typeAliasesPackage: cn.iocoder.mall.user.biz.dataobject
|
||||
|
||||
# dubbo
|
||||
dubbo:
|
||||
application:
|
||||
name: user-service
|
||||
registry:
|
||||
address: zookeeper://127.0.0.1:2181
|
||||
protocol:
|
||||
port: -1
|
||||
name: dubbo
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.user.biz.service
|
||||
provider:
|
||||
filter: -exception
|
||||
MobileCodeService:
|
||||
version: 1.0.0
|
||||
UserAccessLogService:
|
||||
version: 1.0.0
|
||||
UserAddressService:
|
||||
version: 1.0.0
|
||||
UserService:
|
||||
version: 1.0.0
|
||||
consumer:
|
||||
OAuth2Service:
|
||||
version: 1.0.0
|
||||
72
user/user-service-impl/target/classes/mapper/UserAddress.xml
Normal file
72
user/user-service-impl/target/classes/mapper/UserAddress.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.user.biz.dao.UserAddressMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, user_id, area_no, `name`, mobile, address,
|
||||
create_time, update_time, has_default, deleted
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="UserAddressDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO user_address (
|
||||
user_id, area_no, `name`, mobile, address,
|
||||
create_time, update_time, has_default, deleted
|
||||
) VALUES (
|
||||
#{userId}, #{areaNo}, #{name}, #{mobile}, #{address},
|
||||
#{createTime}, #{updateTime}, #{hasDefault}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE user_address
|
||||
<set>
|
||||
<if test="userAddressDO.areaNo != null">
|
||||
, area_no = #{userAddressDO.areaNo}
|
||||
</if>
|
||||
<if test="userAddressDO.name != null">
|
||||
, `name` = #{userAddressDO.name}
|
||||
</if>
|
||||
<if test="userAddressDO.mobile != null">
|
||||
, mobile = #{userAddressDO.mobile}
|
||||
</if>
|
||||
<if test="userAddressDO.address != null">
|
||||
, address = #{userAddressDO.address}
|
||||
</if>
|
||||
<if test="userAddressDO.updateTime != null">
|
||||
, update_time = #{userAddressDO.updateTime}
|
||||
</if>
|
||||
<if test="userAddressDO.hasDefault != null">
|
||||
, has_default = #{userAddressDO.hasDefault}
|
||||
</if>
|
||||
<if test="userAddressDO.deleted != null">
|
||||
, deleted = #{userAddressDO.deleted}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectByUserIdAndId" resultType="cn.iocoder.mall.user.biz.dataobject.UserAddressDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM user_address
|
||||
WHERE user_id = #{userId}
|
||||
AND id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdAndDeleted" resultType="cn.iocoder.mall.user.biz.dataobject.UserAddressDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM user_address
|
||||
WHERE deleted = #{deleted}
|
||||
AND `user_id` = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectHasDefault" resultType="cn.iocoder.mall.user.biz.dataobject.UserAddressDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM user_address
|
||||
WHERE deleted = #{deleted}
|
||||
AND `user_id` = #{userId}
|
||||
AND `has_default` = #{hasDefault}
|
||||
</select>
|
||||
</mapper>
|
||||
88
user/user-service-impl/target/classes/mapper/UserMapper.xml
Normal file
88
user/user-service-impl/target/classes/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.user.biz.dao.UserMapper">
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, mobile, nickname, avatar, status,
|
||||
create_time, deleted
|
||||
</sql>
|
||||
|
||||
<insert id="insert" parameterType="UserDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO users (
|
||||
id, mobile, status, create_time, deleted
|
||||
) VALUES (
|
||||
#{id}, #{mobile}, #{status}, #{createTime}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="UserDO">
|
||||
UPDATE users
|
||||
<set>
|
||||
<if test="mobile != null">
|
||||
, mobile = #{mobile}
|
||||
</if>
|
||||
<if test="nickname != null">
|
||||
, nickname = #{nickname}
|
||||
</if>
|
||||
<if test="avatar != null">
|
||||
, avatar = #{avatar}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
, status = #{status}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
, deleted = #{deleted}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="UserDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM users
|
||||
WHERE id = #{id}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByMobile" parameterType="String" resultType="UserDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM users
|
||||
WHERE mobile = #{mobile}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectListByNicknameLike" resultType="UserDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM users
|
||||
<where>
|
||||
<if test="nickname != null">
|
||||
nickname LIKE "%"#{nickname}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
LIMIT #{offset}, #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByNicknameLike" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM users
|
||||
<where>
|
||||
<if test="nickname != null">
|
||||
nickname LIKE "%"#{nickname}"%"
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.mall.user.biz.dao.UserRegisterMapper">
|
||||
|
||||
<insert id="insert" parameterType="UserRegisterDO">
|
||||
INSERT INTO user_register (
|
||||
id, create_time
|
||||
) VALUES (
|
||||
#{id}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user