|
|
|
<?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.daqing.financial.crms.dao.CustomerDao">
|
|
|
|
|
|
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
|
|
|
<resultMap type="com.daqing.framework.domain.crms.CustomerEntity" id="customerMap">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="code" column="code"/>
|
|
|
|
<result property="type" column="type"/>
|
|
|
|
<result property="manager" column="manager"/>
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="addr" column="addr"/>
|
|
|
|
<result property="phone" column="phone"/>
|
|
|
|
<result property="password" column="password"/>
|
|
|
|
<result property="wechatId" column="wechat_id"/>
|
|
|
|
<result property="delOrNot" column="del_or_not"/>
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="motifyTime" column="motify_time"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 -->
|
|
|
|
<select id="queryList" parameterType="com.daqing.framework.domain.crms.request.CustomerRequest" resultType="com.daqing.framework.domain.crms.CustomerEntity">
|
|
|
|
SELECT id,code,type,name,phone,manager
|
|
|
|
FROM crms_customer
|
|
|
|
WHERE del_or_not = 0
|
|
|
|
<if test="cr.codeOrName != null and cr.codeOrName != '' ">
|
|
|
|
AND name LIKE CONCAT('%',#{cr.codeOrName},'%')
|
|
|
|
OR code LIKE CONCAT('%',#{cr.codeOrName},'%')
|
|
|
|
</if>
|
|
|
|
<if test="cr.customerType != null and cr.customerType != '' ">
|
|
|
|
AND type = #{cr.customerType}
|
|
|
|
</if>
|
|
|
|
<if test="cr.startTime != null and cr.startTime != '' ">
|
|
|
|
AND create_time >= #{cr.startTime}
|
|
|
|
</if>
|
|
|
|
<if test="cr.endTime != null and cr.endTime != '' ">
|
|
|
|
AND create_time <= #{cr.endTime}
|
|
|
|
</if>
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|