|
@@ -12,21 +12,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="age" column="age" />
|
|
|
<result property="isContagion" column="is_contagion" />
|
|
|
<result property="haveContagion" column="have_contagion" />
|
|
|
- <result property="area" column="area" />
|
|
|
+ <result property="provinceCode" column="province_code" />
|
|
|
+ <result property="provinceName" column="province_name" />
|
|
|
+ <result property="cityCode" column="city_code" />
|
|
|
+ <result property="cityName" column="city_name" />
|
|
|
+ <result property="districtCode" column="district_code" />
|
|
|
+ <result property="districtName" column="district_name" />
|
|
|
<result property="address" column="address" />
|
|
|
<result property="isDefault" column="is_default" />
|
|
|
<result property="isDelete" column="is_delete" />
|
|
|
+ <result property="label" column="label" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
<result property="remark" column="remark" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <sql id="selectLAddressVo">
|
|
|
- select address_id, user_id, telephone, name, age, is_contagion, have_contagion, area, address, is_default, is_delete, create_time, update_time, remark from l_address
|
|
|
+ <sql id="selectAddressVo">
|
|
|
+ select address_id, user_id, telephone, name, age, is_contagion, have_contagion, province_code, province_name, city_code, city_name, district_code, district_name, address, is_default, is_delete, label, create_time, create_by, update_time, update_by, remark from l_address
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectLAddressList" parameterType="Address" resultMap="AddressResult">
|
|
|
- <include refid="selectLAddressVo"/>
|
|
|
+ <select id="selectAddressList" parameterType="Address" resultMap="AddressResult">
|
|
|
+ <include refid="selectAddressVo"/>
|
|
|
<where>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
<if test="telephone != null and telephone != ''"> and telephone = #{telephone}</if>
|
|
@@ -34,25 +42,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="age != null "> and age = #{age}</if>
|
|
|
<if test="isContagion != null "> and is_contagion = #{isContagion}</if>
|
|
|
<if test="haveContagion != null and haveContagion != ''"> and have_contagion = #{haveContagion}</if>
|
|
|
- <if test="area != null and area != ''"> and area = #{area}</if>
|
|
|
+ <if test="provinceCode != null and provinceCode != ''"> and province_code = #{provinceCode}</if>
|
|
|
+ <if test="provinceName != null and provinceName != ''"> and province_name like concat('%', #{provinceName}, '%')</if>
|
|
|
+ <if test="cityCode != null and cityCode != ''"> and city_code = #{cityCode}</if>
|
|
|
+ <if test="cityName != null and cityName != ''"> and city_name like concat('%', #{cityName}, '%')</if>
|
|
|
+ <if test="districtCode != null and districtCode != ''"> and district_code = #{districtCode}</if>
|
|
|
+ <if test="districtName != null and districtName != ''"> and district_name like concat('%', #{districtName}, '%')</if>
|
|
|
<if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
<if test="isDefault != null "> and is_default = #{isDefault}</if>
|
|
|
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ <if test="label != null and label != ''"> and label = #{label}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectLAddressByAddressId" parameterType="Long" resultMap="AddressResult">
|
|
|
- <include refid="selectLAddressVo"/>
|
|
|
+ <select id="selectAddressByAddressId" parameterType="Long" resultMap="AddressResult">
|
|
|
+ <include refid="selectAddressVo"/>
|
|
|
where address_id = #{addressId}
|
|
|
</select>
|
|
|
- <select id="selectByUserId" resultType="com.leromro.core.domain.Address" parameterType="java.lang.Long">
|
|
|
- <include refid="selectLAddressVo"/>
|
|
|
- <where>
|
|
|
- user_id = #{userId}
|
|
|
- </where>
|
|
|
- </select>
|
|
|
|
|
|
- <insert id="insertLAddress" parameterType="Address" useGeneratedKeys="true" keyProperty="addressId">
|
|
|
+ <insert id="insertAddress" parameterType="Address" useGeneratedKeys="true" keyProperty="addressId">
|
|
|
insert into l_address
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="userId != null">user_id,</if>
|
|
@@ -61,12 +69,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="age != null">age,</if>
|
|
|
<if test="isContagion != null">is_contagion,</if>
|
|
|
<if test="haveContagion != null">have_contagion,</if>
|
|
|
- <if test="area != null">area,</if>
|
|
|
+ <if test="provinceCode != null">province_code,</if>
|
|
|
+ <if test="provinceName != null">province_name,</if>
|
|
|
+ <if test="cityCode != null">city_code,</if>
|
|
|
+ <if test="cityName != null">city_name,</if>
|
|
|
+ <if test="districtCode != null">district_code,</if>
|
|
|
+ <if test="districtName != null">district_name,</if>
|
|
|
<if test="address != null">address,</if>
|
|
|
<if test="isDefault != null">is_default,</if>
|
|
|
<if test="isDelete != null">is_delete,</if>
|
|
|
+ <if test="label != null">label,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
@@ -76,17 +92,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="age != null">#{age},</if>
|
|
|
<if test="isContagion != null">#{isContagion},</if>
|
|
|
<if test="haveContagion != null">#{haveContagion},</if>
|
|
|
- <if test="area != null">#{area},</if>
|
|
|
+ <if test="provinceCode != null">#{provinceCode},</if>
|
|
|
+ <if test="provinceName != null">#{provinceName},</if>
|
|
|
+ <if test="cityCode != null">#{cityCode},</if>
|
|
|
+ <if test="cityName != null">#{cityName},</if>
|
|
|
+ <if test="districtCode != null">#{districtCode},</if>
|
|
|
+ <if test="districtName != null">#{districtName},</if>
|
|
|
<if test="address != null">#{address},</if>
|
|
|
<if test="isDefault != null">#{isDefault},</if>
|
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
|
+ <if test="label != null">#{label},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
- <update id="updateLAddress" parameterType="Address">
|
|
|
+ <update id="updateAddress" parameterType="Address">
|
|
|
update l_address
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
@@ -95,22 +119,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="age != null">age = #{age},</if>
|
|
|
<if test="isContagion != null">is_contagion = #{isContagion},</if>
|
|
|
<if test="haveContagion != null">have_contagion = #{haveContagion},</if>
|
|
|
- <if test="area != null">area = #{area},</if>
|
|
|
+ <if test="provinceCode != null">province_code = #{provinceCode},</if>
|
|
|
+ <if test="provinceName != null">province_name = #{provinceName},</if>
|
|
|
+ <if test="cityCode != null">city_code = #{cityCode},</if>
|
|
|
+ <if test="cityName != null">city_name = #{cityName},</if>
|
|
|
+ <if test="districtCode != null">district_code = #{districtCode},</if>
|
|
|
+ <if test="districtName != null">district_name = #{districtName},</if>
|
|
|
<if test="address != null">address = #{address},</if>
|
|
|
<if test="isDefault != null">is_default = #{isDefault},</if>
|
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ <if test="label != null">label = #{label},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
</trim>
|
|
|
where address_id = #{addressId}
|
|
|
</update>
|
|
|
+ <update id="updateDefaultAddress">
|
|
|
+ update l_address set is_default = #{isDefault} where user_id = #{userId}
|
|
|
+ </update>
|
|
|
|
|
|
- <delete id="deleteLAddressByAddressId" parameterType="Long">
|
|
|
+ <delete id="deleteAddressByAddressId" parameterType="Long">
|
|
|
delete from l_address where address_id = #{addressId}
|
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteLAddressByAddressIds" parameterType="String">
|
|
|
+ <delete id="deleteAddressByAddressIds" parameterType="String">
|
|
|
delete from l_address where address_id in
|
|
|
<foreach item="addressId" collection="array" open="(" separator="," close=")">
|
|
|
#{addressId}
|