|
|
@@ -378,4 +378,136 @@
|
|
|
tag = #{tag,jdbcType=VARCHAR}
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
+
|
|
|
+ <update id="updateCustomerByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
|
|
|
+ update customer
|
|
|
+ <set>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid = #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="customerTyp != null">
|
|
|
+ customer_typ = #{customerTyp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="shareTyp != null">
|
|
|
+ share_typ = #{shareTyp,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="agentId != null">
|
|
|
+ agent_id = #{agentId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyIntention != null">
|
|
|
+ company_intention = #{companyIntention,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="followSituation != null">
|
|
|
+ follow_situation = #{followSituation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="customerStatue != null">
|
|
|
+ customer_statue = #{customerStatue,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="paid != null">
|
|
|
+ paid = #{paid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
|
|
|
+ <!--
|
|
|
+ WARNING - @mbg.generated
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
+ This element was generated on Wed Oct 11 15:40:31 CST 2017.
|
|
|
+ -->
|
|
|
+ insert into customer
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ aid,
|
|
|
+ </if>
|
|
|
+ <if test="customerTyp != null">
|
|
|
+ customer_typ,
|
|
|
+ </if>
|
|
|
+ <if test="shareTyp != null">
|
|
|
+ share_typ,
|
|
|
+ </if>
|
|
|
+ <if test="agentId != null">
|
|
|
+ agent_id,
|
|
|
+ </if>
|
|
|
+ <if test="companyIntention != null">
|
|
|
+ company_intention,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="followSituation != null">
|
|
|
+ follow_situation,
|
|
|
+ </if>
|
|
|
+ <if test="customerStatue != null">
|
|
|
+ customer_statue,
|
|
|
+ </if>
|
|
|
+ <if test="paid != null">
|
|
|
+ paid,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="aid != null">
|
|
|
+ #{aid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="customerTyp != null">
|
|
|
+ #{customerTyp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="shareTyp != null">
|
|
|
+ #{shareTyp,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="agentId != null">
|
|
|
+ #{agentId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyIntention != null">
|
|
|
+ #{companyIntention,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="followSituation != null">
|
|
|
+ #{followSituation,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="customerStatue != null">
|
|
|
+ #{customerStatue,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="paid != null">
|
|
|
+ #{paid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="deleteCustomerByPrimaryKey" parameterType="java.lang.String">
|
|
|
+ delete from customer
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerBo">
|
|
|
+ select
|
|
|
+ a.customer_typ as customerTyp,
|
|
|
+ a.share_typ as shareTyp,
|
|
|
+ a.company_intention as companyIntention,
|
|
|
+ a.create_time as createTime,
|
|
|
+ a.follow_situation as followSituation,
|
|
|
+ a.customer_statue as customerStatue,
|
|
|
+ b.name,b.sex,b.mobile,b.tel_num as telNum,b.email,b.qq,b.wechat,b.depatrment,b.remarks,
|
|
|
+ b.customer_position as customerPosition,
|
|
|
+ c.company_name as companyName,
|
|
|
+ c.location_province as locationProvince,
|
|
|
+ c.company_industry as companyIndustry,
|
|
|
+ c.adress -->
|
|
|
+ from customer a
|
|
|
+ left join customer_user_info b on a.id=b.cid
|
|
|
+ left join customer_organization_info c on a.id=c.cid
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
</mapper>
|