|
@@ -2,6 +2,11 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.goafanti.common.dao.CustomerMapper">
|
|
<mapper namespace="com.goafanti.common.dao.CustomerMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.Customer">
|
|
<resultMap id="BaseResultMap" type="com.goafanti.common.model.Customer">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
<result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
<result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
<result column="customer_typ" jdbcType="VARCHAR" property="customerTyp" />
|
|
<result column="customer_typ" jdbcType="VARCHAR" property="customerTyp" />
|
|
@@ -12,12 +17,13 @@
|
|
|
<result column="follow_situation" jdbcType="VARCHAR" property="followSituation" />
|
|
<result column="follow_situation" jdbcType="VARCHAR" property="followSituation" />
|
|
|
<result column="customer_statue" jdbcType="VARCHAR" property="customerStatue" />
|
|
<result column="customer_statue" jdbcType="VARCHAR" property="customerStatue" />
|
|
|
<result column="paid" jdbcType="VARCHAR" property="paid" />
|
|
<result column="paid" jdbcType="VARCHAR" property="paid" />
|
|
|
|
|
+ <result column="tag" jdbcType="VARCHAR" property="tag" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<sql id="Example_Where_Clause">
|
|
<sql id="Example_Where_Clause">
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
<where>
|
|
<where>
|
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
@@ -47,39 +53,84 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
+ <sql id="Update_By_Example_Where_Clause">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
|
|
+ <if test="criteria.valid">
|
|
|
|
|
+ <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
|
|
+ <choose>
|
|
|
|
|
+ <when test="criterion.noValue">
|
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="criterion.singleValue">
|
|
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
|
|
+ </when>
|
|
|
|
|
+ <when test="criterion.listValue">
|
|
|
|
|
+ and ${criterion.condition}
|
|
|
|
|
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
+ #{listItem}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </when>
|
|
|
|
|
+ </choose>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </sql>
|
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
id, aid, customer_typ, share_typ, agent_id, company_intention, create_time, follow_situation,
|
|
id, aid, customer_typ, share_typ, agent_id, company_intention, create_time, follow_situation,
|
|
|
- customer_statue, paid
|
|
|
|
|
|
|
+ customer_statue, paid, tag
|
|
|
</sql>
|
|
</sql>
|
|
|
- <select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerBo">
|
|
|
|
|
|
|
+ <select id="selectByExample" parameterType="com.goafanti.common.model.CustomerExample" resultMap="BaseResultMap">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
|
|
+ select
|
|
|
|
|
+ <if test="distinct">
|
|
|
|
|
+ distinct
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from customer
|
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderByClause != null">
|
|
|
|
|
+ order by ${orderByClause}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
select
|
|
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
|
|
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from customer
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
|
|
- <delete id="deleteCustomerByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
delete from customer
|
|
delete from customer
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
@@ -88,7 +139,7 @@
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
delete from customer
|
|
delete from customer
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
@@ -99,22 +150,22 @@
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
insert into customer (id, aid, customer_typ,
|
|
insert into customer (id, aid, customer_typ,
|
|
|
share_typ, agent_id, company_intention,
|
|
share_typ, agent_id, company_intention,
|
|
|
create_time, follow_situation, customer_statue,
|
|
create_time, follow_situation, customer_statue,
|
|
|
- paid)
|
|
|
|
|
|
|
+ paid, tag)
|
|
|
values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{customerTyp,jdbcType=VARCHAR},
|
|
values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{customerTyp,jdbcType=VARCHAR},
|
|
|
#{shareTyp,jdbcType=INTEGER}, #{agentId,jdbcType=VARCHAR}, #{companyIntention,jdbcType=VARCHAR},
|
|
#{shareTyp,jdbcType=INTEGER}, #{agentId,jdbcType=VARCHAR}, #{companyIntention,jdbcType=VARCHAR},
|
|
|
#{createTime,jdbcType=TIMESTAMP}, #{followSituation,jdbcType=VARCHAR}, #{customerStatue,jdbcType=VARCHAR},
|
|
#{createTime,jdbcType=TIMESTAMP}, #{followSituation,jdbcType=VARCHAR}, #{customerStatue,jdbcType=VARCHAR},
|
|
|
- #{paid,jdbcType=VARCHAR})
|
|
|
|
|
|
|
+ #{paid,jdbcType=VARCHAR}, #{tag,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
</insert>
|
|
|
- <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
|
|
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
insert into customer
|
|
insert into customer
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -148,6 +199,9 @@
|
|
|
<if test="paid != null">
|
|
<if test="paid != null">
|
|
|
paid,
|
|
paid,
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="tag != null">
|
|
|
|
|
+ tag,
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
@@ -180,20 +234,96 @@
|
|
|
<if test="paid != null">
|
|
<if test="paid != null">
|
|
|
#{paid,jdbcType=VARCHAR},
|
|
#{paid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="tag != null">
|
|
|
|
|
+ #{tag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
</trim>
|
|
</trim>
|
|
|
</insert>
|
|
</insert>
|
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.CustomerExample" resultType="java.lang.Long">
|
|
<select id="countByExample" parameterType="com.goafanti.common.model.CustomerExample" resultType="java.lang.Long">
|
|
|
<!--
|
|
<!--
|
|
|
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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
-->
|
|
-->
|
|
|
select count(*) from customer
|
|
select count(*) from customer
|
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
|
<include refid="Example_Where_Clause" />
|
|
<include refid="Example_Where_Clause" />
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
- <update id="updateCustomerByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
|
|
|
|
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
|
|
+ update customer
|
|
|
|
|
+ <set>
|
|
|
|
|
+ <if test="record.id != null">
|
|
|
|
|
+ id = #{record.id,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.aid != null">
|
|
|
|
|
+ aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.customerTyp != null">
|
|
|
|
|
+ customer_typ = #{record.customerTyp,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.shareTyp != null">
|
|
|
|
|
+ share_typ = #{record.shareTyp,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.agentId != null">
|
|
|
|
|
+ agent_id = #{record.agentId,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.companyIntention != null">
|
|
|
|
|
+ company_intention = #{record.companyIntention,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.createTime != null">
|
|
|
|
|
+ create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.followSituation != null">
|
|
|
|
|
+ follow_situation = #{record.followSituation,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.customerStatue != null">
|
|
|
|
|
+ customer_statue = #{record.customerStatue,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.paid != null">
|
|
|
|
|
+ paid = #{record.paid,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="record.tag != null">
|
|
|
|
|
+ tag = #{record.tag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
|
|
+ <!--
|
|
|
|
|
+ WARNING - @mbg.generated
|
|
|
|
|
+ This element is automatically generated by MyBatis Generator, do not modify.
|
|
|
|
|
+ This element was generated on Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
|
|
+ update customer
|
|
|
|
|
+ set id = #{record.id,jdbcType=VARCHAR},
|
|
|
|
|
+ aid = #{record.aid,jdbcType=VARCHAR},
|
|
|
|
|
+ customer_typ = #{record.customerTyp,jdbcType=VARCHAR},
|
|
|
|
|
+ share_typ = #{record.shareTyp,jdbcType=INTEGER},
|
|
|
|
|
+ agent_id = #{record.agentId,jdbcType=VARCHAR},
|
|
|
|
|
+ company_intention = #{record.companyIntention,jdbcType=VARCHAR},
|
|
|
|
|
+ create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ follow_situation = #{record.followSituation,jdbcType=VARCHAR},
|
|
|
|
|
+ customer_statue = #{record.customerStatue,jdbcType=VARCHAR},
|
|
|
|
|
+ paid = #{record.paid,jdbcType=VARCHAR},
|
|
|
|
|
+ tag = #{record.tag,jdbcType=VARCHAR}
|
|
|
|
|
+ <if test="_parameter != null">
|
|
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" 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 Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
update customer
|
|
update customer
|
|
|
<set>
|
|
<set>
|
|
|
<if test="aid != null">
|
|
<if test="aid != null">
|
|
@@ -223,7 +353,29 @@
|
|
|
<if test="paid != null">
|
|
<if test="paid != null">
|
|
|
paid = #{paid,jdbcType=VARCHAR},
|
|
paid = #{paid,jdbcType=VARCHAR},
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="tag != null">
|
|
|
|
|
+ tag = #{tag,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
</set>
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
+ <update id="updateByPrimaryKey" 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 Thu Oct 12 20:42:55 CST 2017.
|
|
|
|
|
+ -->
|
|
|
|
|
+ update customer
|
|
|
|
|
+ set aid = #{aid,jdbcType=VARCHAR},
|
|
|
|
|
+ customer_typ = #{customerTyp,jdbcType=VARCHAR},
|
|
|
|
|
+ share_typ = #{shareTyp,jdbcType=INTEGER},
|
|
|
|
|
+ agent_id = #{agentId,jdbcType=VARCHAR},
|
|
|
|
|
+ company_intention = #{companyIntention,jdbcType=VARCHAR},
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ follow_situation = #{followSituation,jdbcType=VARCHAR},
|
|
|
|
|
+ customer_statue = #{customerStatue,jdbcType=VARCHAR},
|
|
|
|
|
+ paid = #{paid,jdbcType=VARCHAR},
|
|
|
|
|
+ tag = #{tag,jdbcType=VARCHAR}
|
|
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </update>
|
|
|
</mapper>
|
|
</mapper>
|