| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- <?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.goafanti.common.dao.UserBusinessMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserBusiness">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="follow_situation" jdbcType="INTEGER" property="followSituation" />
- <result column="customer_status" jdbcType="INTEGER" property="customerStatus" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="business_project_id" jdbcType="VARCHAR" property="businessProjectId" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- <where>
- <foreach collection="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="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- <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
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- id, uid, aid, follow_situation, customer_status, create_time, update_time, remarks,
- business_project_id
- </sql>
- <select id="selectByExample" parameterType="com.goafanti.common.model.UserBusinessExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from user_business
- <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 Sat May 05 10:50:19 CST 2018.
- -->
- select
- <include refid="Base_Column_List" />
- from user_business
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- delete from user_business
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.UserBusinessExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- delete from user_business
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.UserBusiness">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- insert into user_business (id, uid, aid,
- follow_situation, customer_status, create_time,
- update_time, remarks, business_project_id
- )
- values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
- #{followSituation,jdbcType=INTEGER}, #{customerStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{updateTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{businessProjectId,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.UserBusiness">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- insert into user_business
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="uid != null">
- uid,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="followSituation != null">
- follow_situation,
- </if>
- <if test="customerStatus != null">
- customer_status,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="businessProjectId != null">
- business_project_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="followSituation != null">
- #{followSituation,jdbcType=INTEGER},
- </if>
- <if test="customerStatus != null">
- #{customerStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="businessProjectId != null">
- #{businessProjectId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.UserBusinessExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- select count(*) from user_business
- <if test="_parameter != null">
- <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 Sat May 05 10:50:19 CST 2018.
- -->
- update user_business
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.uid != null">
- uid = #{record.uid,jdbcType=VARCHAR},
- </if>
- <if test="record.aid != null">
- aid = #{record.aid,jdbcType=VARCHAR},
- </if>
- <if test="record.followSituation != null">
- follow_situation = #{record.followSituation,jdbcType=INTEGER},
- </if>
- <if test="record.customerStatus != null">
- customer_status = #{record.customerStatus,jdbcType=INTEGER},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.updateTime != null">
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.remarks != null">
- remarks = #{record.remarks,jdbcType=VARCHAR},
- </if>
- <if test="record.businessProjectId != null">
- business_project_id = #{record.businessProjectId,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 Sat May 05 10:50:19 CST 2018.
- -->
- update user_business
- set id = #{record.id,jdbcType=VARCHAR},
- uid = #{record.uid,jdbcType=VARCHAR},
- aid = #{record.aid,jdbcType=VARCHAR},
- follow_situation = #{record.followSituation,jdbcType=INTEGER},
- customer_status = #{record.customerStatus,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
- remarks = #{record.remarks,jdbcType=VARCHAR},
- business_project_id = #{record.businessProjectId,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserBusiness">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- update user_business
- <set>
- <if test="uid != null">
- uid = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="followSituation != null">
- follow_situation = #{followSituation,jdbcType=INTEGER},
- </if>
- <if test="customerStatus != null">
- customer_status = #{customerStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null">
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="businessProjectId != null">
- business_project_id = #{businessProjectId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserBusiness">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Sat May 05 10:50:19 CST 2018.
- -->
- update user_business
- set uid = #{uid,jdbcType=VARCHAR},
- aid = #{aid,jdbcType=VARCHAR},
- follow_situation = #{followSituation,jdbcType=INTEGER},
- customer_status = #{customerStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- remarks = #{remarks,jdbcType=VARCHAR},
- business_project_id = #{businessProjectId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <select id="selectBusinessGlossory" resultType="com.goafanti.customer.bo.BusinessListBo">
- select id as businessGlossoryId,name as businessName from business_glossory
- </select>
-
- <select id="judgeBusiness" resultType="java.lang.Integer">
- select count(0) from user_business where
- uid = #{uid,jdbcType=VARCHAR} and customer_status != 6
- <if test="businessProjectId != null and businessProjectId != ''">
- and business_project_id = #{businessProjectId,jdbcType=VARCHAR}
- </if>
- <if test="aid != null and aid != ''">
- and aid = #{aid,jdbcType=VARCHAR}
- </if>
- </select>
-
- <select id="selectBusinessByUAid" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BusinessListBo">
- select
- a.id as businessId,
- a.uid,
- a.business_project_id as businessProjectId,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- a.remarks,
- b.bname as businessProjectName,
- c.cname as businessvarietiesName
- from user_business a
- left join business_project b on a.business_project_id = b.id
- left join business_category c on b.cid = c.id
- where a.uid = #{uid,jdbcType=VARCHAR} and a.aid = #{aid,jdbcType=VARCHAR} and a.customer_status != 6
- order by a.create_time
- </select>
-
- <select id="selectLockedBusinessByUAid" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BusinessListBo">
- select
- x.id as businessId,
- x.uid,
- 5 as followSituation,
- x.customer_status as customerStatus,
- y.business_project_id as businessProjectId,
- y.bname as businessProjectName,
- y.cname as businessvarietiesName
- from(
- select
- id,
- uid,
- business_project_id,
- follow_situation,
- customer_status,
- remarks
- from user_business
- where uid = #{uid} and aid = #{aid} and customer_status != 6
- )x right join(
- select
- a.business_project_id,
- b.bname,
- c.cname
- from user_lock_release a
- left join business_project b on a.business_project_id = b.id
- left join business_category c on b.cid = c.id
- where a.uid = #{uid} and a.aid = #{aid} and a.type = 1 and a.status = 0
- )y on x.business_project_id = y.business_project_id
- </select>
-
- <select id="selectFollowCountByUAid" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(0) from user_follow where uid = #{uid,jdbcType=VARCHAR} and aid = #{aid,jdbcType=VARCHAR}
- </select>
-
-
- <select id="findBusinessDetail" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BussinessFollowBo">
- select
- a.id as businessId,
- a.uid,
- a.business_project_id as businessProjectId,
- a.create_time as createTime,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- a.remarks,
- b.identify_name as identifyName,
- c.name as adminName,
- d.bname as businessProjectName
- from
- user_business a left join user b on
- a.uid = b.id left join admin c on
- a.aid = c.id left join business_project d on
- a.business_project_id = d.id
- where a.id = #{businessId,jdbcType=VARCHAR}
- </select>
-
- <select id="findFollowOneBusiness" parameterType="java.lang.String" resultType="com.goafanti.customer.bo.BussinessFollowBo">
- select
- a.customer_status as customerStatus,
- a.follow_situation as followSituation,
- a.remarks,
- a.business_project_id as businessProjectId,
- b.id as followId,
- b.create_time as createTime,
- b.result,
- b.contact_type as contactType,
- d.name as contacts,
- d.mobile as contactMobile,
- b.create_time as followTime,
- e.name as adminName,
- f.identify_name as identifyName,
- g.bname as businessProjectName
- from
- user_follow_business a
- left join user_follow b on a.follow_id = b.id
- left join user_business c on a.business_id = c.id
- left join organization_contact_book d on b.ocb_id = d.id
- left join admin e on b.aid = e.id
- left join user f on b.uid = f.id
- left join business_project g on a.business_project_id = g.id
- where a.id = #{ufbId,jdbcType=VARCHAR}
- </select>
- <update id="updateDimissionTransfer" parameterType="java.lang.String">
- update user_business
- set aid= #{transferId,jdbcType=VARCHAR}
- where aid= #{aid,jdbcType=VARCHAR}
- </update>
- <select id="selectBusinessProjectByUAPid" resultType="com.goafanti.customer.bo.BusinessListBo">
- select
- a.id as businessId,
- a.uid,
- a.business_project_id as businessProjectId,
- a.follow_situation as followSituation,
- a.customer_status as customerStatus,
- a.remarks,
- b.bname as businessProjectName,
- c.cname as businessvarietiesName
- from user_business a
- left join business_project b on a.business_project_id = b.id
- left join business_category c on b.cid = c.id
- where a.uid = #{uid,jdbcType=VARCHAR} and a.aid = #{aid,jdbcType=VARCHAR}
- and a.business_project_id= #{pid} and a.customer_status != 6
- </select>
- <select id="checkLock" resultType="java.lang.Integer">
- select count(*) from user_business
- where aid= #{aid} and uid= #{uid} and business_project_id = #{pid}
-
- </select>
- </mapper>
|