收货地址管理
This commit is contained in:
parent
00a073709e
commit
616f4dfb1a
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1534927909" Name="mall" Objects="1018" Symbols="127" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
|
||||
<?PowerDesigner AppLocale="UTF16" ID="{7BB41C87-EFE8-409A-A86E-B1C3FCE34F8C}" Label="" LastModificationDate="1535436964" Name="mall" Objects="1007" Symbols="127" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
|
||||
<!-- do not edit this file -->
|
||||
|
||||
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
|
||||
@ -13158,11 +13158,11 @@ LABL 0 新宋体,8,N</a:FontList>
|
||||
</o:Column>
|
||||
<o:Column Id="o715">
|
||||
<a:ObjectID>4EDEC710-4328-4BF8-BCCC-EA8EAAA48FF1</a:ObjectID>
|
||||
<a:Name>address</a:Name>
|
||||
<a:Code>address</a:Code>
|
||||
<a:Name>detail_address</a:Name>
|
||||
<a:Code>detail_address</a:Code>
|
||||
<a:CreationDate>1522390108</a:CreationDate>
|
||||
<a:Creator>zhenghong</a:Creator>
|
||||
<a:ModificationDate>1522390238</a:ModificationDate>
|
||||
<a:ModificationDate>1535436964</a:ModificationDate>
|
||||
<a:Modifier>zhenghong</a:Modifier>
|
||||
<a:Comment>收货地址</a:Comment>
|
||||
<a:DataType>varchar(128)</a:DataType>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,11 +17,11 @@ public class UmsMemberReceiveAddress implements Serializable {
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
* 是否为默认
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String address;
|
||||
private Integer defaultStatus;
|
||||
|
||||
/**
|
||||
* 邮政编码
|
||||
@ -31,11 +31,32 @@ public class UmsMemberReceiveAddress implements Serializable {
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 是否为默认
|
||||
* 省份/直辖市
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Integer defaultStatus;
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* 详细地址(街道)
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private String detailAddress;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -71,12 +92,12 @@ public class UmsMemberReceiveAddress implements Serializable {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
public Integer getDefaultStatus() {
|
||||
return defaultStatus;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
public void setDefaultStatus(Integer defaultStatus) {
|
||||
this.defaultStatus = defaultStatus;
|
||||
}
|
||||
|
||||
public String getPostCode() {
|
||||
@ -87,12 +108,36 @@ public class UmsMemberReceiveAddress implements Serializable {
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
public Integer getDefaultStatus() {
|
||||
return defaultStatus;
|
||||
public String getProvince() {
|
||||
return province;
|
||||
}
|
||||
|
||||
public void setDefaultStatus(Integer defaultStatus) {
|
||||
this.defaultStatus = defaultStatus;
|
||||
public void setProvince(String province) {
|
||||
this.province = province;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getDetailAddress() {
|
||||
return detailAddress;
|
||||
}
|
||||
|
||||
public void setDetailAddress(String detailAddress) {
|
||||
this.detailAddress = detailAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -105,9 +150,12 @@ public class UmsMemberReceiveAddress implements Serializable {
|
||||
sb.append(", memberId=").append(memberId);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", phoneNumber=").append(phoneNumber);
|
||||
sb.append(", address=").append(address);
|
||||
sb.append(", postCode=").append(postCode);
|
||||
sb.append(", defaultStatus=").append(defaultStatus);
|
||||
sb.append(", postCode=").append(postCode);
|
||||
sb.append(", province=").append(province);
|
||||
sb.append(", city=").append(city);
|
||||
sb.append(", region=").append(region);
|
||||
sb.append(", detailAddress=").append(detailAddress);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
|
@ -364,73 +364,63 @@ public class UmsMemberReceiveAddressExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressIsNull() {
|
||||
addCriterion("address is null");
|
||||
public Criteria andDefaultStatusIsNull() {
|
||||
addCriterion("default_status is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressIsNotNull() {
|
||||
addCriterion("address is not null");
|
||||
public Criteria andDefaultStatusIsNotNull() {
|
||||
addCriterion("default_status is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressEqualTo(String value) {
|
||||
addCriterion("address =", value, "address");
|
||||
public Criteria andDefaultStatusEqualTo(Integer value) {
|
||||
addCriterion("default_status =", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressNotEqualTo(String value) {
|
||||
addCriterion("address <>", value, "address");
|
||||
public Criteria andDefaultStatusNotEqualTo(Integer value) {
|
||||
addCriterion("default_status <>", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressGreaterThan(String value) {
|
||||
addCriterion("address >", value, "address");
|
||||
public Criteria andDefaultStatusGreaterThan(Integer value) {
|
||||
addCriterion("default_status >", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("address >=", value, "address");
|
||||
public Criteria andDefaultStatusGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("default_status >=", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressLessThan(String value) {
|
||||
addCriterion("address <", value, "address");
|
||||
public Criteria andDefaultStatusLessThan(Integer value) {
|
||||
addCriterion("default_status <", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressLessThanOrEqualTo(String value) {
|
||||
addCriterion("address <=", value, "address");
|
||||
public Criteria andDefaultStatusLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("default_status <=", value, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressLike(String value) {
|
||||
addCriterion("address like", value, "address");
|
||||
public Criteria andDefaultStatusIn(List<Integer> values) {
|
||||
addCriterion("default_status in", values, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressNotLike(String value) {
|
||||
addCriterion("address not like", value, "address");
|
||||
public Criteria andDefaultStatusNotIn(List<Integer> values) {
|
||||
addCriterion("default_status not in", values, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressIn(List<String> values) {
|
||||
addCriterion("address in", values, "address");
|
||||
public Criteria andDefaultStatusBetween(Integer value1, Integer value2) {
|
||||
addCriterion("default_status between", value1, value2, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressNotIn(List<String> values) {
|
||||
addCriterion("address not in", values, "address");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressBetween(String value1, String value2) {
|
||||
addCriterion("address between", value1, value2, "address");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAddressNotBetween(String value1, String value2) {
|
||||
addCriterion("address not between", value1, value2, "address");
|
||||
public Criteria andDefaultStatusNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("default_status not between", value1, value2, "defaultStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
@ -504,63 +494,283 @@ public class UmsMemberReceiveAddressExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusIsNull() {
|
||||
addCriterion("default_status is null");
|
||||
public Criteria andProvinceIsNull() {
|
||||
addCriterion("province is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusIsNotNull() {
|
||||
addCriterion("default_status is not null");
|
||||
public Criteria andProvinceIsNotNull() {
|
||||
addCriterion("province is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusEqualTo(Integer value) {
|
||||
addCriterion("default_status =", value, "defaultStatus");
|
||||
public Criteria andProvinceEqualTo(String value) {
|
||||
addCriterion("province =", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusNotEqualTo(Integer value) {
|
||||
addCriterion("default_status <>", value, "defaultStatus");
|
||||
public Criteria andProvinceNotEqualTo(String value) {
|
||||
addCriterion("province <>", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusGreaterThan(Integer value) {
|
||||
addCriterion("default_status >", value, "defaultStatus");
|
||||
public Criteria andProvinceGreaterThan(String value) {
|
||||
addCriterion("province >", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("default_status >=", value, "defaultStatus");
|
||||
public Criteria andProvinceGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("province >=", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusLessThan(Integer value) {
|
||||
addCriterion("default_status <", value, "defaultStatus");
|
||||
public Criteria andProvinceLessThan(String value) {
|
||||
addCriterion("province <", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("default_status <=", value, "defaultStatus");
|
||||
public Criteria andProvinceLessThanOrEqualTo(String value) {
|
||||
addCriterion("province <=", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusIn(List<Integer> values) {
|
||||
addCriterion("default_status in", values, "defaultStatus");
|
||||
public Criteria andProvinceLike(String value) {
|
||||
addCriterion("province like", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusNotIn(List<Integer> values) {
|
||||
addCriterion("default_status not in", values, "defaultStatus");
|
||||
public Criteria andProvinceNotLike(String value) {
|
||||
addCriterion("province not like", value, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusBetween(Integer value1, Integer value2) {
|
||||
addCriterion("default_status between", value1, value2, "defaultStatus");
|
||||
public Criteria andProvinceIn(List<String> values) {
|
||||
addCriterion("province in", values, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDefaultStatusNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("default_status not between", value1, value2, "defaultStatus");
|
||||
public Criteria andProvinceNotIn(List<String> values) {
|
||||
addCriterion("province not in", values, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProvinceBetween(String value1, String value2) {
|
||||
addCriterion("province between", value1, value2, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andProvinceNotBetween(String value1, String value2) {
|
||||
addCriterion("province not between", value1, value2, "province");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityIsNull() {
|
||||
addCriterion("city is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityIsNotNull() {
|
||||
addCriterion("city is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityEqualTo(String value) {
|
||||
addCriterion("city =", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityNotEqualTo(String value) {
|
||||
addCriterion("city <>", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityGreaterThan(String value) {
|
||||
addCriterion("city >", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("city >=", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityLessThan(String value) {
|
||||
addCriterion("city <", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityLessThanOrEqualTo(String value) {
|
||||
addCriterion("city <=", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityLike(String value) {
|
||||
addCriterion("city like", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityNotLike(String value) {
|
||||
addCriterion("city not like", value, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityIn(List<String> values) {
|
||||
addCriterion("city in", values, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityNotIn(List<String> values) {
|
||||
addCriterion("city not in", values, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityBetween(String value1, String value2) {
|
||||
addCriterion("city between", value1, value2, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCityNotBetween(String value1, String value2) {
|
||||
addCriterion("city not between", value1, value2, "city");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionIsNull() {
|
||||
addCriterion("region is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionIsNotNull() {
|
||||
addCriterion("region is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionEqualTo(String value) {
|
||||
addCriterion("region =", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionNotEqualTo(String value) {
|
||||
addCriterion("region <>", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionGreaterThan(String value) {
|
||||
addCriterion("region >", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("region >=", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionLessThan(String value) {
|
||||
addCriterion("region <", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionLessThanOrEqualTo(String value) {
|
||||
addCriterion("region <=", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionLike(String value) {
|
||||
addCriterion("region like", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionNotLike(String value) {
|
||||
addCriterion("region not like", value, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionIn(List<String> values) {
|
||||
addCriterion("region in", values, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionNotIn(List<String> values) {
|
||||
addCriterion("region not in", values, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionBetween(String value1, String value2) {
|
||||
addCriterion("region between", value1, value2, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRegionNotBetween(String value1, String value2) {
|
||||
addCriterion("region not between", value1, value2, "region");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressIsNull() {
|
||||
addCriterion("detail_address is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressIsNotNull() {
|
||||
addCriterion("detail_address is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressEqualTo(String value) {
|
||||
addCriterion("detail_address =", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressNotEqualTo(String value) {
|
||||
addCriterion("detail_address <>", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressGreaterThan(String value) {
|
||||
addCriterion("detail_address >", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("detail_address >=", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressLessThan(String value) {
|
||||
addCriterion("detail_address <", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressLessThanOrEqualTo(String value) {
|
||||
addCriterion("detail_address <=", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressLike(String value) {
|
||||
addCriterion("detail_address like", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressNotLike(String value) {
|
||||
addCriterion("detail_address not like", value, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressIn(List<String> values) {
|
||||
addCriterion("detail_address in", values, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressNotIn(List<String> values) {
|
||||
addCriterion("detail_address not in", values, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressBetween(String value1, String value2) {
|
||||
addCriterion("detail_address between", value1, value2, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDetailAddressNotBetween(String value1, String value2) {
|
||||
addCriterion("detail_address not between", value1, value2, "detailAddress");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,12 @@
|
||||
<result column="member_id" jdbcType="BIGINT" property="memberId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="post_code" jdbcType="VARCHAR" property="postCode" />
|
||||
<result column="default_status" jdbcType="INTEGER" property="defaultStatus" />
|
||||
<result column="post_code" jdbcType="VARCHAR" property="postCode" />
|
||||
<result column="province" jdbcType="VARCHAR" property="province" />
|
||||
<result column="city" jdbcType="VARCHAR" property="city" />
|
||||
<result column="region" jdbcType="VARCHAR" property="region" />
|
||||
<result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
@ -69,7 +72,8 @@
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, member_id, name, phone_number, address, post_code, default_status
|
||||
id, member_id, name, phone_number, default_status, post_code, province, city, region,
|
||||
detail_address
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.macro.mall.model.UmsMemberReceiveAddressExample" resultMap="BaseResultMap">
|
||||
select
|
||||
@ -106,10 +110,12 @@
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ums_member_receive_address (member_id, name, phone_number,
|
||||
address, post_code, default_status
|
||||
default_status, post_code, province,
|
||||
city, region, detail_address
|
||||
)
|
||||
values (#{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
|
||||
#{address,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR}, #{defaultStatus,jdbcType=INTEGER}
|
||||
#{defaultStatus,jdbcType=INTEGER}, #{postCode,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR},
|
||||
#{city,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR}, #{detailAddress,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberReceiveAddress">
|
||||
@ -127,14 +133,23 @@
|
||||
<if test="phoneNumber != null">
|
||||
phone_number,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
<if test="defaultStatus != null">
|
||||
default_status,
|
||||
</if>
|
||||
<if test="postCode != null">
|
||||
post_code,
|
||||
</if>
|
||||
<if test="defaultStatus != null">
|
||||
default_status,
|
||||
<if test="province != null">
|
||||
province,
|
||||
</if>
|
||||
<if test="city != null">
|
||||
city,
|
||||
</if>
|
||||
<if test="region != null">
|
||||
region,
|
||||
</if>
|
||||
<if test="detailAddress != null">
|
||||
detail_address,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -147,14 +162,23 @@
|
||||
<if test="phoneNumber != null">
|
||||
#{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
<if test="defaultStatus != null">
|
||||
#{defaultStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="postCode != null">
|
||||
#{postCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultStatus != null">
|
||||
#{defaultStatus,jdbcType=INTEGER},
|
||||
<if test="province != null">
|
||||
#{province,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="city != null">
|
||||
#{city,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="region != null">
|
||||
#{region,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="detailAddress != null">
|
||||
#{detailAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -179,14 +203,23 @@
|
||||
<if test="record.phoneNumber != null">
|
||||
phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.address != null">
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
<if test="record.defaultStatus != null">
|
||||
default_status = #{record.defaultStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.postCode != null">
|
||||
post_code = #{record.postCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.defaultStatus != null">
|
||||
default_status = #{record.defaultStatus,jdbcType=INTEGER},
|
||||
<if test="record.province != null">
|
||||
province = #{record.province,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.city != null">
|
||||
city = #{record.city,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.region != null">
|
||||
region = #{record.region,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.detailAddress != null">
|
||||
detail_address = #{record.detailAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
@ -199,9 +232,12 @@
|
||||
member_id = #{record.memberId,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
phone_number = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
default_status = #{record.defaultStatus,jdbcType=INTEGER},
|
||||
post_code = #{record.postCode,jdbcType=VARCHAR},
|
||||
default_status = #{record.defaultStatus,jdbcType=INTEGER}
|
||||
province = #{record.province,jdbcType=VARCHAR},
|
||||
city = #{record.city,jdbcType=VARCHAR},
|
||||
region = #{record.region,jdbcType=VARCHAR},
|
||||
detail_address = #{record.detailAddress,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@ -218,14 +254,23 @@
|
||||
<if test="phoneNumber != null">
|
||||
phone_number = #{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
<if test="defaultStatus != null">
|
||||
default_status = #{defaultStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="postCode != null">
|
||||
post_code = #{postCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultStatus != null">
|
||||
default_status = #{defaultStatus,jdbcType=INTEGER},
|
||||
<if test="province != null">
|
||||
province = #{province,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="city != null">
|
||||
city = #{city,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="region != null">
|
||||
region = #{region,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="detailAddress != null">
|
||||
detail_address = #{detailAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
@ -235,9 +280,12 @@
|
||||
set member_id = #{memberId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
phone_number = #{phoneNumber,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
default_status = #{defaultStatus,jdbcType=INTEGER},
|
||||
post_code = #{postCode,jdbcType=VARCHAR},
|
||||
default_status = #{defaultStatus,jdbcType=INTEGER}
|
||||
province = #{province,jdbcType=VARCHAR},
|
||||
city = #{city,jdbcType=VARCHAR},
|
||||
region = #{region,jdbcType=VARCHAR},
|
||||
detail_address = #{detailAddress,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -45,8 +45,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.permitAll()
|
||||
.antMatchers("/sso/*")// 对登录注册要允许匿名访问
|
||||
.permitAll()
|
||||
.antMatchers("/member/**")// 测试mongo时开启
|
||||
.permitAll()
|
||||
// .antMatchers("/member/**")// 测试mongo时开启
|
||||
// .permitAll()
|
||||
.anyRequest()// 除上面外的所有请求全部需要鉴权认证
|
||||
.authenticated()
|
||||
.and()
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.macro.mall.portal.controller;
|
||||
|
||||
import com.macro.mall.model.UmsMemberReceiveAddress;
|
||||
import com.macro.mall.portal.domain.CommonResult;
|
||||
import com.macro.mall.portal.service.UmsMemberReceiveAddressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址管理Controller
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "UmsMemberReceiveAddressController", description = "会员收货地址管理")
|
||||
@RequestMapping("/member/address")
|
||||
public class UmsMemberReceiveAddressController {
|
||||
@Autowired
|
||||
private UmsMemberReceiveAddressService memberReceiveAddressService;
|
||||
@ApiOperation("添加收货地址")
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object add(@RequestBody UmsMemberReceiveAddress address) {
|
||||
int count = memberReceiveAddressService.add(address);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("删除收货地址")
|
||||
@RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object delete(@PathVariable Long id) {
|
||||
int count = memberReceiveAddressService.delete(id);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("修改收货地址")
|
||||
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object update(@PathVariable Long id,@RequestBody UmsMemberReceiveAddress address) {
|
||||
int count = memberReceiveAddressService.update(id,address);
|
||||
if(count>0){
|
||||
return new CommonResult().success(count);
|
||||
}
|
||||
return new CommonResult().failed();
|
||||
}
|
||||
|
||||
@ApiOperation("显示所有收货地址")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object list() {
|
||||
List<UmsMemberReceiveAddress> addressList = memberReceiveAddressService.list();
|
||||
return new CommonResult().success(addressList);
|
||||
}
|
||||
|
||||
@ApiOperation("显示所有收货地址")
|
||||
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public Object getItem(@PathVariable Long id) {
|
||||
UmsMemberReceiveAddress address = memberReceiveAddressService.getItem(id);
|
||||
return new CommonResult().success(address);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.macro.mall.portal.service;
|
||||
|
||||
import com.macro.mall.model.UmsMemberReceiveAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户地址管理Service
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
public interface UmsMemberReceiveAddressService {
|
||||
/**
|
||||
* 添加收货地址
|
||||
*/
|
||||
int add(UmsMemberReceiveAddress address);
|
||||
|
||||
/**
|
||||
* 删除收货地址
|
||||
* @param id 地址表的id
|
||||
*/
|
||||
int delete(Long id);
|
||||
|
||||
/**
|
||||
* 修改收货地址
|
||||
* @param id 地址表的id
|
||||
* @param address 修改的收货地址信息
|
||||
*/
|
||||
int update(Long id, UmsMemberReceiveAddress address);
|
||||
|
||||
/**
|
||||
* 返回当前用户的收货地址
|
||||
*/
|
||||
List<UmsMemberReceiveAddress> list();
|
||||
|
||||
/**
|
||||
* 获取地址详情
|
||||
* @param id 地址id
|
||||
*/
|
||||
UmsMemberReceiveAddress getItem(Long id);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.macro.mall.portal.service.impl;
|
||||
|
||||
import com.macro.mall.mapper.UmsMemberReceiveAddressMapper;
|
||||
import com.macro.mall.model.UmsMember;
|
||||
import com.macro.mall.model.UmsMemberReceiveAddress;
|
||||
import com.macro.mall.model.UmsMemberReceiveAddressExample;
|
||||
import com.macro.mall.portal.service.UmsMemberReceiveAddressService;
|
||||
import com.macro.mall.portal.service.UmsMemberService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户地址管理Service实现类
|
||||
* Created by macro on 2018/8/28.
|
||||
*/
|
||||
@Service
|
||||
public class UmsMemberReceiveAddressServiceImpl implements UmsMemberReceiveAddressService {
|
||||
@Autowired
|
||||
private UmsMemberService memberService;
|
||||
@Autowired
|
||||
private UmsMemberReceiveAddressMapper addressMapper;
|
||||
@Override
|
||||
public int add(UmsMemberReceiveAddress address) {
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
address.setMemberId(currentMember.getId());
|
||||
return addressMapper.insert(address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id) {
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
|
||||
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
|
||||
return addressMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Long id, UmsMemberReceiveAddress address) {
|
||||
address.setId(null);
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
|
||||
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
|
||||
return addressMapper.updateByExampleSelective(address,example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UmsMemberReceiveAddress> list() {
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
|
||||
example.createCriteria().andMemberIdEqualTo(currentMember.getId());
|
||||
return addressMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UmsMemberReceiveAddress getItem(Long id) {
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
|
||||
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
|
||||
List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
|
||||
if(!CollectionUtils.isEmpty(addressList)){
|
||||
return addressList.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user