<?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="com.nova.sankuai.infra.mapper.CustomerPushRecordMapper">
|
|
<select id="pageModel" resultType="com.nova.sankuai.domain.vo.CustomerPushRecordVo">
|
select
|
cpr.id as id,
|
cu.phone as phone,
|
cpr.mechanism_id as mechanismId,
|
su.company_name as mechanismName,
|
cpr.customer_record_id as customerRecordId,
|
cpr.creation_date as creationDate,
|
cpr.deduction_id as deductionId,
|
cpr.status as status,
|
cpr.memo as memo,
|
cu.name as customerRecordName
|
from customer_push_record cpr
|
left join sys_user su on cpr.mechanism_id = su.id
|
left join customer cu on cpr.customer_record_id = cu.id
|
<where>
|
su.delete_flag = 0 and cu.delete_flag = 0
|
<if test="pageDto.mechanismId != null">
|
and cpr.mechanism_id = #{pageDto.mechanismId}
|
</if>
|
<if test="pageDto.mechanismName != null and pageDto.mechanismName !=''">
|
and su.company_name like concat('%',#{pageDto.mechanismName},'%')
|
</if>
|
<if test="pageDto.phone != null and pageDto.phone !=''">
|
and cu.phone like concat('%',#{pageDto.phone},'%')
|
</if>
|
<if test="pageDto.startDate != null">
|
and cpr.creation_date >= #{pageDto.startDate}
|
</if>
|
<if test="pageDto.endDate != null">
|
and cpr.creation_date <= #{pageDto.endDate}
|
</if>
|
<if test="pageDto.status != null">
|
and cpr.status = #{pageDto.status}
|
</if>
|
</where>
|
order by cpr.creation_date desc
|
</select>
|
|
</mapper>
|