| | |
| | | <sql id="Base_Column_List"> |
| | | address_id, user_id, receiver_name, receiver_phone, province, city, district, street, detail, longitude, latitude, is_default, tag, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | <update id="isDefault"> |
| | | update sh_user_address set is_default = false where user_id = #{userId} |
| | | </update> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sh_user_address |
| | | <where> |
| | | <if test="criteria.userId != null"> |
| | | <if test="criteria.userId != null and criteria.userId != ''"> |
| | | and user_id = #{criteria.userId} |
| | | </if> |
| | | <if test="criteria.tag != null"> |
| | | <if test="criteria.tag != null and criteria.tag != ''"> |
| | | and tag = #{criteria.tag} |
| | | </if> |
| | | <if test="criteria.phone != null and criteria.phone != ''"> |
| | | and receiver_phone like concat('%',#{criteria.phone},'%') |
| | | </if> |
| | | <if test="criteria.createTime != null and criteria.createTime.size() > 0"> |
| | | AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]} |
| | |
| | | </where> |
| | | order by address_id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |