<?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.ruoyi.system.mapper.TCrmChangePointsMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.system.model.TCrmChangePoints">
|
<id column="id" property="id" />
|
<result column="branch_salesperson_id" property="branchSalespersonId" />
|
<result column="procurement_id" property="procurementId" />
|
<result column="exchange_id" property="exchangeId" />
|
<result column="user_type" property="userType" />
|
<result column="change_type" property="changeType" />
|
<result column="change_reason" property="changeReason" />
|
<result column="change_value" property="changeValue" />
|
<result column="remarks" property="remarks" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
<result column="create_by" property="createBy" />
|
<result column="update_by" property="updateBy" />
|
<result column="disabled" property="disabled" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, branch_salesperson_id,procurement_id,exchange_id, user_type, change_type,change_reason, change_value, remarks, create_time, update_time, create_by, update_by, disabled
|
</sql>
|
<select id="pageListBranch" resultType="com.ruoyi.system.vo.TCrmChangePointsVO">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcb.branch_name as branchName
|
from t_crm_change_points tccp
|
left join t_crm_branch tcb on tcb.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.branchName != null and query.branchName != ''">
|
and tcb.branch_name like concat('%',#{query.branchName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 1
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
<select id="pageListSalesperson" resultType="com.ruoyi.system.vo.TCrmChangePointsVO">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcs.salesperson_name as salespersonName
|
from t_crm_change_points tccp
|
left join t_crm_salesperson tcs on tcs.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.salespersonName != null and query.salespersonName != ''">
|
and tcs.salesperson_name like concat('%',#{query.salespersonName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 2
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
<select id="pageListClinic" resultType="com.ruoyi.system.vo.TCrmChangePointsVO">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcc.clinic_name as clinicName
|
from t_crm_change_points tccp
|
left join t_crm_clinic tcc on tcc.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.clinicName != null and query.clinicName != ''">
|
and tcc.clinic_name like concat('%',#{query.clinicName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 3
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
<select id="pageListBranchExport" resultType="com.ruoyi.system.export.TCrmChangePointsBranchExport">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcb.branch_name as branchName
|
from t_crm_change_points tccp
|
left join t_crm_branch tcb on tcb.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.branchName != null and query.branchName != ''">
|
and tcb.branch_name like concat('%',#{query.branchName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 1
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
<select id="pageListSalespersonExport"
|
resultType="com.ruoyi.system.export.TCrmChangePointsSalespersonExport">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcs.salesperson_name as salespersonName
|
from t_crm_change_points tccp
|
left join t_crm_salesperson tcs on tcs.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.salespersonName != null and query.salespersonName != ''">
|
and tcs.salesperson_name like concat('%',#{query.salespersonName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 2
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
<select id="pageListClinicExport" resultType="com.ruoyi.system.export.TCrmChangePointsClinicExport">
|
select
|
tccp.id, tccp.branch_salesperson_id,tccp.procurement_id,tccp.exchange_id, tccp.user_type, tccp.change_type,
|
tccp.change_reason, tccp.change_value, tccp.remarks, tccp.create_time, tccp.update_time, tccp.create_by,
|
tccp.update_by, tccp.disabled,tcc.clinic_name as clinicName
|
from t_crm_change_points tccp
|
left join t_crm_clinic tcc on tcc.id = tccp.branch_salesperson_id
|
<where>
|
<if test="query.clinicName != null and query.clinicName != ''">
|
and tcc.clinic_name like concat('%',#{query.clinicName},'%')
|
</if>
|
<if test="query.changeType != null">
|
and tccp.change_type = #{query.changeType}
|
</if>
|
<if test="query.changeReason != null">
|
and tccp.change_reason = #{query.changeReason}
|
</if>
|
<if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
|
AND tccp.create_time >= #{query.startTime}
|
AND tccp.create_time <= #{query.endTime}
|
</if>
|
AND tccp.user_type = 3
|
AND tccp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tccp.create_time DESC
|
</select>
|
|
</mapper>
|