|
@@ -116,26 +116,40 @@
|
|
|
order by ${orderByClause}
|
|
order by ${orderByClause}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Fri Oct 13 15:28:17 CST 2017.
|
|
This element was generated on Fri Oct 13 15:28:17 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
select
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
|
|
- from customer
|
|
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
|
+ a.id,
|
|
|
|
|
+ a.aid,
|
|
|
|
|
+ a.paid,
|
|
|
|
|
+ a.share_type as shareType,
|
|
|
|
|
+ a.customer_type as customerType,
|
|
|
|
|
+ a.customer_status as customerStatus,
|
|
|
|
|
+ a.company_intention as companyIntention,
|
|
|
|
|
+ a.follow_situation as followSituation,
|
|
|
|
|
+ a.tag,
|
|
|
|
|
+ a.create_time as createTime,
|
|
|
|
|
+ a.follow_id followId,
|
|
|
|
|
+ a.from customer a
|
|
|
|
|
+ where effective=0 and id = #{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
- <!--
|
|
|
|
|
|
|
+ <!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
+
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
This element was generated on Fri Oct 13 15:28:17 CST 2017.
|
|
This element was generated on Fri Oct 13 15:28:17 CST 2017.
|
|
|
- -->
|
|
|
|
|
|
|
+
|
|
|
delete from customer
|
|
delete from customer
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
- </delete>
|
|
|
|
|
|
|
+ </delete> -->
|
|
|
|
|
+ <update id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
+ update customer set effective =1 where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
<delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerExample">
|
|
<delete id="deleteByExample" parameterType="com.goafanti.common.model.CustomerExample">
|
|
|
<!--
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
WARNING - @mbg.generated
|
|
@@ -161,7 +175,7 @@
|
|
|
values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{paid,jdbcType=VARCHAR},
|
|
values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{paid,jdbcType=VARCHAR},
|
|
|
#{shareType,jdbcType=INTEGER}, #{customerType,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER},
|
|
#{shareType,jdbcType=INTEGER}, #{customerType,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER},
|
|
|
#{companyIntention,jdbcType=CHAR}, #{followSituation,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR},
|
|
#{companyIntention,jdbcType=CHAR}, #{followSituation,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR},
|
|
|
- #{createTime,jdbcType=TIMESTAMP}, #{followId,jdbcType=VARCHAR}, #{effective,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{followId,jdbcType=VARCHAR}, 0
|
|
|
)
|
|
)
|
|
|
</insert>
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
|
|
@@ -400,7 +414,7 @@
|
|
|
<select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
|
|
<select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerOut">
|
|
|
select
|
|
select
|
|
|
a.customer_typ as customerTyp,
|
|
a.customer_typ as customerTyp,
|
|
|
- a.share_typ as shareTyp,
|
|
|
|
|
|
|
+ a.share_type as shareTyp,
|
|
|
a.company_intention as companyIntention,
|
|
a.company_intention as companyIntention,
|
|
|
a.create_time as createTime,
|
|
a.create_time as createTime,
|
|
|
a.follow_situation as followSituation,
|
|
a.follow_situation as followSituation,
|
|
@@ -417,11 +431,54 @@
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
- <select id="selectCustomer" parameterType="com.goafanti.customer.bo.CustomerIn" resultType="com.goafanti.customer.bo.CustomerOut">
|
|
|
|
|
- select a.id,a.customer_typ as customerTyp,a.share_typ as shareTyp,a.tag,a.follow_situation as followSituation,
|
|
|
|
|
- c.name as contactName,c.mobile,c.tel_num as telNum,
|
|
|
|
|
- d.company_name as customerName,d.location_province as locationProvince,
|
|
|
|
|
- e.name as adminName
|
|
|
|
|
|
|
+ <select id="selectCustomer" resultType="com.goafanti.customer.bo.CustomerOut">
|
|
|
|
|
+ select a.id,a.customer_type as customerType,a.share_type as shareType,a.company_intention as CompanyIntention,
|
|
|
|
|
+ a.tag,a.follow_situation as followSituation,a.customer_status as customerStatus,
|
|
|
|
|
+ b.follow_date as followDate,
|
|
|
|
|
+ c.name as contactName ,c.mobile,c.tel_num as telNum,
|
|
|
|
|
+ d.company_name as companyName,d.location_province as locationProvince,
|
|
|
|
|
+ e.name as adminName,
|
|
|
|
|
+ b.follow_date as followDate
|
|
|
|
|
+ from customer a
|
|
|
|
|
+ left join follow_up_record b on a.follow_id = b.id
|
|
|
|
|
+ left join customer_user_info c on b.cuid = c.id
|
|
|
|
|
+ left join customer_organization_info d on a.id = d.cid
|
|
|
|
|
+ left join admin e on a.aid = e.id
|
|
|
|
|
+ where a.effective = 0
|
|
|
|
|
+ <if test="aid != null">
|
|
|
|
|
+ and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="shareTyp != null">
|
|
|
|
|
+ and a.share_type = #{shareTyp,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="customerType != null">
|
|
|
|
|
+ and a.customer_type = #{customerTyp,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="customerStauts != null">
|
|
|
|
|
+ and a.customer_status = #{customerStauts,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="companyIntention != null">
|
|
|
|
|
+ and a.company_intention = #{companyIntention,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="followSituation != null">
|
|
|
|
|
+ and a.follow_situation = #{followSituation,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contactName != null">
|
|
|
|
|
+ and c.name = #{contactName,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contactTel != null">
|
|
|
|
|
+ and c.tel_num = #{contactTel,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="adminName != null">
|
|
|
|
|
+ and e.name = #{adminName,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="page_sql!=null">
|
|
|
|
|
+ ${page_sql}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectCustomerCount" resultType="java.lang.Integer">
|
|
|
|
|
+ select count(0)
|
|
|
from customer a
|
|
from customer a
|
|
|
left join follow_up_record b on a.follow_id = b.id
|
|
left join follow_up_record b on a.follow_id = b.id
|
|
|
left join customer_user_info c on b.cuid = c.id
|
|
left join customer_user_info c on b.cuid = c.id
|
|
@@ -432,10 +489,10 @@
|
|
|
and a.aid = #{aid,jdbcType=VARCHAR}
|
|
and a.aid = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="shareTyp != null">
|
|
<if test="shareTyp != null">
|
|
|
- and a.share_typ = #{shareTyp,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ and a.share_type = #{shareTyp,jdbcType=INTEGER}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerType != null">
|
|
<if test="customerType != null">
|
|
|
- and a.customer_typ = #{customerTyp,jdbcType=INTEGER}
|
|
|
|
|
|
|
+ and a.customer_type = #{customerTyp,jdbcType=INTEGER}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="customerStauts != null">
|
|
<if test="customerStauts != null">
|
|
|
and a.customer_status = #{customerStauts,jdbcType=INTEGER}
|
|
and a.customer_status = #{customerStauts,jdbcType=INTEGER}
|