10 changed files with 316 additions and 37 deletions
@ -1,11 +1,20 @@ |
|||
package cc.hiver.core.logisticsaddressbook.mapper; |
|||
|
|||
import cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook; |
|||
import cc.hiver.core.logisticsaddressbook.vo.LogisticsAddressBookQueryVo; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
public interface LogisticsAddressBookMapper extends BaseMapper<LogisticsAddressBook> { |
|||
|
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LogisticsAddressBookMapper extends BaseMapper<LogisticsAddressBook> { |
|||
|
|||
/** |
|||
* 根据名称(支持拼音模糊匹配)及手机号查询列表 |
|||
* @author 王富康 |
|||
* @date 2024/10/8 |
|||
* @param logisticsAddressBookQueryVo |
|||
* @return List<LogisticsAddressBook> |
|||
*/ |
|||
List<LogisticsAddressBook> getLogisticsAddressBookList(@Param("queryParams") LogisticsAddressBookQueryVo logisticsAddressBookQueryVo); |
|||
} |
|||
|
|||
@ -0,0 +1,184 @@ |
|||
<?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="cc.hiver.core.logisticsaddressbook.mapper.LogisticsAddressBookMapper"> |
|||
<resultMap id="BaseResultMap" type="cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook"> |
|||
<id column="id" jdbcType="VARCHAR" property="id" /> |
|||
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="del_flag" jdbcType="INTEGER" property="delFlag" /> |
|||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
<result column="shipper_or_receiver_name" jdbcType="VARCHAR" property="shipperOrReceiverName" /> |
|||
<result column="address_type" jdbcType="INTEGER" property="addressType" /> |
|||
<result column="mobile" jdbcType="VARCHAR" property="mobile" /> |
|||
<result column="address_info" jdbcType="VARCHAR" property="addressInfo" /> |
|||
<result column="company_id" jdbcType="VARCHAR" property="companyId" /> |
|||
<result column="company_name" jdbcType="VARCHAR" property="companyName" /> |
|||
</resultMap> |
|||
|
|||
<sql id="Base_Column_List"> |
|||
id, create_by, create_time, del_flag, update_by, update_time, shipper_or_receiver_name, address_type, mobile, address_info, company_id, company_name |
|||
</sql> |
|||
|
|||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_logistics_address_book |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</select> |
|||
|
|||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
|||
delete from t_logistics_address_book |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</delete> |
|||
|
|||
<insert id="insert" parameterType="cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook"> |
|||
insert into t_logistics_address_book |
|||
(id, create_by, create_time, del_flag, update_by, update_time, shipper_or_receiver_name, address_type, mobile, address_info, company_id, company_name) |
|||
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|||
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|||
#{shipperOrReceiverName,jdbcType=VARCHAR}, #{addressType,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR}, |
|||
#{addressInfo,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}) |
|||
</insert> |
|||
|
|||
<update id="updateByExampleSelective" parameterType="map"> |
|||
update t_logistics_address_book |
|||
<set> |
|||
<if test="record.id != null"> |
|||
id = #{record.id,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.createBy != null"> |
|||
create_by = #{record.createBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.createTime != null"> |
|||
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.delFlag != null"> |
|||
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="record.updateBy != null"> |
|||
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.updateTime != null"> |
|||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.shipperOrReceiverName != null"> |
|||
shipper_or_receiver_name = #{record.shipperOrReceiverName,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.addressType != null"> |
|||
address_type = #{record.addressType,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="record.mobile != null"> |
|||
mobile = #{record.mobile,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.addressInfo != null"> |
|||
address_info = #{record.addressInfo,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.companyId != null"> |
|||
company_id = #{record.companyId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.companyName != null"> |
|||
company_name = #{record.companyName,jdbcType=VARCHAR}, |
|||
</if> |
|||
</set> |
|||
</update> |
|||
|
|||
<update id="updateByExample" parameterType="map"> |
|||
update t_logistics_address_book |
|||
set id = #{record.id,jdbcType=VARCHAR}, |
|||
create_by = #{record.createBy,jdbcType=VARCHAR}, |
|||
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
|||
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
|||
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
|||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
|||
shipper_or_receiver_name = #{record.shipperOrReceiverName,jdbcType=VARCHAR}, |
|||
address_type = #{record.addressType,jdbcType=INTEGER}, |
|||
mobile = #{record.mobile,jdbcType=VARCHAR}, |
|||
address_info = #{record.addressInfo,jdbcType=VARCHAR}, |
|||
company_id = #{record.companyId,jdbcType=VARCHAR}, |
|||
company_name = #{record.companyName,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook"> |
|||
update t_logistics_address_book |
|||
<set> |
|||
<if test="createBy != null"> |
|||
create_by = #{createBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createTime != null"> |
|||
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="delFlag != null"> |
|||
del_flag = #{delFlag,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="updateBy != null"> |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="updateTime != null"> |
|||
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="shipperOrReceiverName != null"> |
|||
shipper_or_receiver_name = #{shipperOrReceiverName,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="addressType != null"> |
|||
address_type = #{addressType,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="mobile != null"> |
|||
mobile = #{mobile,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="addressInfo != null"> |
|||
address_info = #{addressInfo,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="companyId != null"> |
|||
company_id = #{companyId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="companyName != null"> |
|||
company_name = #{companyName,jdbcType=VARCHAR}, |
|||
</if> |
|||
</set> |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKey" parameterType="cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook"> |
|||
update t_logistics_address_book |
|||
set create_by = #{createBy,jdbcType=VARCHAR}, |
|||
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|||
del_flag = #{delFlag,jdbcType=INTEGER}, |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
|||
shipper_or_receiver_name = #{shipperOrReceiverName,jdbcType=VARCHAR}, |
|||
address_type = #{addressType,jdbcType=INTEGER}, |
|||
mobile = #{mobile,jdbcType=VARCHAR}, |
|||
address_info = #{addressInfo,jdbcType=VARCHAR}, |
|||
company_id = #{companyId,jdbcType=VARCHAR}, |
|||
company_name = #{companyName,jdbcType=VARCHAR} |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<!--管理商品分页列表--> |
|||
<select id="getLogisticsAddressBookList" resultMap="BaseResultMap" parameterType="cc.hiver.core.logisticsaddressbook.vo.LogisticsAddressBookQueryVo"> |
|||
select |
|||
t.id, t.create_by,t.create_time,t.del_flag,t.update_by,t.update_time, |
|||
t.shipper_or_receiver_name, t.address_type, t.mobile, t.address_info, t.company_id, t.company_name |
|||
from t_logistics_address_book t |
|||
<where> |
|||
t.address_type = #{queryParams.addressType} |
|||
AND ( |
|||
<if test='queryParams.shipperOrReceiverName!=null and queryParams.shipperOrReceiverName.trim() neq ""'> |
|||
t.shipper_or_receiver_name LIKE CONCAT( '%', #{queryParams.shipperOrReceiverName}, '%' ) |
|||
OR to_pinyin ( t.shipper_or_receiver_name ) LIKE CONCAT( '%', to_pinyin ( #{queryParams.shipperOrReceiverName} ), '%' ) |
|||
OR to_initial_pinyin ( t.shipper_or_receiver_name ) LIKE CONCAT( '%', #{queryParams.shipperOrReceiverName}, '%' ) |
|||
</if> |
|||
<if test='queryParams.mobile!=null and queryParams.mobile.trim() neq ""'> |
|||
<if test='queryParams.shipperOrReceiverName!=null and queryParams.shipperOrReceiverName.trim() neq ""'> |
|||
or |
|||
</if> |
|||
t.mobile LIKE CONCAT( '%', #{queryParams.mobile}, '%' ) |
|||
</if> |
|||
) |
|||
</where> |
|||
ORDER BY |
|||
t.create_time desc |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue