|
|
@@ -2,11 +2,6 @@
|
|
|
<!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">
|
|
|
<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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
- -->
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
<result column="aid" jdbcType="VARCHAR" property="aid" />
|
|
|
<result column="customer_typ" jdbcType="VARCHAR" property="customerTyp" />
|
|
|
@@ -52,40 +47,6 @@
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</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 Wed Oct 11 15:40:31 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">
|
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
|
@@ -95,36 +56,25 @@
|
|
|
id, aid, customer_typ, share_typ, agent_id, company_intention, create_time, follow_situation,
|
|
|
customer_statue, paid
|
|
|
</sql>
|
|
|
- <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 Wed Oct 11 15:40:31 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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
- -->
|
|
|
+ <select id="selectCustomerByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.CustomerBo">
|
|
|
select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from customer
|
|
|
+ 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>
|
|
|
+ </select>
|
|
|
<delete id="deleteCustomerByPrimaryKey" parameterType="java.lang.String">
|
|
|
<!--
|
|
|
WARNING - @mbg.generated
|
|
|
@@ -243,76 +193,7 @@
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
</if>
|
|
|
</select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
- <!--
|
|
|
- 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.
|
|
|
- -->
|
|
|
- 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>
|
|
|
- </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 Wed Oct 11 15:40:31 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}
|
|
|
- <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 Wed Oct 11 15:40:31 CST 2017.
|
|
|
- -->
|
|
|
+ <update id="updateCustomerByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
|
|
|
update customer
|
|
|
<set>
|
|
|
<if test="aid != null">
|
|
|
@@ -345,22 +226,4 @@
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</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 Wed Oct 11 15:40:31 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}
|
|
|
- where id = #{id,jdbcType=VARCHAR}
|
|
|
- </update>
|
|
|
</mapper>
|