| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <?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.CustomerMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.Customer">
- <id column="id" jdbcType="VARCHAR" property="id" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="company_nmae" jdbcType="VARCHAR" property="companyName" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="company_industry" jdbcType="VARCHAR" property="companyIndustry" />
- <result column="company_intention" jdbcType="VARCHAR" property="companyIntention" />
- <result column="adress" jdbcType="VARCHAR" property="adress" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="customer_position" jdbcType="VARCHAR" property="customerPosition" />
- <result column="mobile" jdbcType="VARCHAR" property="mobile" />
- <result column="email" jdbcType="VARCHAR" property="email" />
- <result column="department" jdbcType="VARCHAR" property="department" />
- <result column="qq" jdbcType="VARCHAR" property="qq" />
- <result column="wechat" jdbcType="VARCHAR" property="wechat" />
- <result column="remark" jdbcType="VARCHAR" property="remark" />
- <result column="province" jdbcType="VARCHAR" property="province" />
- <result column="fllow_situation" jdbcType="VARCHAR" property="fllowSituation" />
- <result column="sex" jdbcType="INTEGER" property="sex" />
- <result column="customer_statue" jdbcType="VARCHAR" property="customerStatue" />
- <result column="customer_typ" jdbcType="INTEGER" property="customerTyp" />
- <result column="tel_num" jdbcType="VARCHAR" property="telNum" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <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">
- <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">
- id, aid, company_nmae, create_time, company_industry, company_intention, adress,
- customer_name, customer_position, mobile, email, department, qq, wechat, remark,
- province, fllow_situation, sex, customer_statue
- </sql>
-
- <!-- 查询单个客户信息 -->
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from customer
- where id = #{id,jdbcType=VARCHAR}
- </select>
-
- <!-- 删除用户 -->
- <update id="deleteByPrimaryKey" parameterType="java.lang.String">
- update customer set delete_flg= 1
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
- <!-- 新增客户 -->
- <insert id="insertCustomer" parameterType="com.goafanti.common.model.Customer">
- insert into customer (id, aid, company_nmae,
- create_time, company_industry, company_intention,
- adress, customer_name, customer_position,
- mobile, email, department,
- qq, wechat, remark,
- province, fllow_situation, sex,
- customer_statue,customer_typ,tel_num,typ,delete_flg)
- values (#{id,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP}, #{companyIndustry,jdbcType=VARCHAR}, #{companyIntention,jdbcType=VARCHAR},
- #{adress,jdbcType=VARCHAR}, #{customerName,jdbcType=VARCHAR}, #{customerPosition,jdbcType=VARCHAR},
- #{mobile,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
- #{qq,jdbcType=VARCHAR}, #{wechat,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
- #{province,jdbcType=VARCHAR}, #{fllowSituation,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER},
- #{customerStatue,jdbcType=VARCHAR}, #{customerTyp,jdbcType=INTEGER}, #{telNum,jdbcType=VARCHAR},0,0)
- </insert>
-
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Customer">
- insert into customer
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="companyName != null">
- company_nmae,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="companyIndustry != null">
- company_industry,
- </if>
- <if test="companyIntention != null">
- company_intention,
- </if>
- <if test="adress != null">
- adress,
- </if>
- <if test="customerName != null">
- customer_name,
- </if>
- <if test="customerPosition != null">
- customer_position,
- </if>
- <if test="mobile != null">
- mobile,
- </if>
- <if test="email != null">
- email,
- </if>
- <if test="department != null">
- department,
- </if>
- <if test="qq != null">
- qq,
- </if>
- <if test="wechat != null">
- wechat,
- </if>
- <if test="remark != null">
- remark,
- </if>
- <if test="province != null">
- province,
- </if>
- <if test="fllowSituation != null">
- fllow_situation,
- </if>
- <if test="sex != null">
- sex,
- </if>
- <if test="customerStatue != null">
- customer_statue,
- </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="companyName != null">
- #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="companyIndustry != null">
- #{companyIndustry,jdbcType=VARCHAR},
- </if>
- <if test="companyIntention != null">
- #{companyIntention,jdbcType=VARCHAR},
- </if>
- <if test="adress != null">
- #{adress,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null">
- #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="customerPosition != null">
- #{customerPosition,jdbcType=VARCHAR},
- </if>
- <if test="mobile != null">
- #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="department != null">
- #{department,jdbcType=VARCHAR},
- </if>
- <if test="qq != null">
- #{qq,jdbcType=VARCHAR},
- </if>
- <if test="wechat != null">
- #{wechat,jdbcType=VARCHAR},
- </if>
- <if test="remark != null">
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- #{province,jdbcType=VARCHAR},
- </if>
- <if test="fllowSituation != null">
- #{fllowSituation,jdbcType=VARCHAR},
- </if>
- <if test="sex != null">
- #{sex,jdbcType=INTEGER},
- </if>
- <if test="customerStatue != null">
- #{customerStatue,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
-
- <!-- 修改客户信息 -->
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Customer">
- update customer
- <set>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="companyName != null">
- company_nmae = #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="companyIndustry != null">
- company_industry = #{companyIndustry,jdbcType=VARCHAR},
- </if>
- <if test="companyIntention != null">
- company_intention = #{companyIntention,jdbcType=VARCHAR},
- </if>
- <if test="adress != null">
- adress = #{adress,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null">
- customer_name = #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="customerPosition != null">
- customer_position = #{customerPosition,jdbcType=VARCHAR},
- </if>
- <if test="mobile != null">
- mobile = #{mobile,jdbcType=VARCHAR},
- </if>
- <if test="email != null">
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="department != null">
- department = #{department,jdbcType=VARCHAR},
- </if>
- <if test="qq != null">
- qq = #{qq,jdbcType=VARCHAR},
- </if>
- <if test="wechat != null">
- wechat = #{wechat,jdbcType=VARCHAR},
- </if>
- <if test="remark != null">
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="fllowSituation != null">
- fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
- </if>
- <if test="sex != null">
- sex = #{sex,jdbcType=INTEGER},
- </if>
- <if test="customerStatue != null">
- customer_statue = #{customerStatue,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
-
- <!-- 分页查询客户 -->
- <select id="findSearchCustomerListByPage" resultType="com.goafanti.common.model.Customer">
- select
- a.id,
- a.company_name as companyName ,
- a.customer_typ as customerTyp ,
- a.province ,
- a.tel_num as telNum ,
- a.customer_name as customerName ,
- a.customer_statue as customerStatue,
- a.Company_intention as CompanyIntention ,
- a.fllow_situation as fllowSituation
- from aft.customer a
- where a.delete_flg = 0
- and a.aid=#{aid,jdbcType=VARCHAR}
- <if test="companyName != null">
- a.company_name = #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="telNum != null">
- a.tel_num = #{telNum,jdbcType=VARCHAR},
- </if>
- <if test="customerTyp != null">
- a.typ = #{customerTyp,jdbcType=INTEGER},
- </if>
- <if test="companyIntention != null">
- a.company_intention = #{companyIntention,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null">
- a.customer_name = #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- a.province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="fllowSituation != null">
- a.fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
- </if>
- <if test="customerStatue != null">
- a.customer_statue = #{customerStatue,jdbcType=VARCHAR},
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
-
- </select>
-
- <!-- 分页查询客户 -->
- <select id="findSearchCustomerCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from customer a
- where a.delete_flg = 0
- and a.aid=#{aid,jdbcType=VARCHAR}
- <if test="companyName != null">
- a.company_name = #{companyName,jdbcType=VARCHAR},
- </if>
- <if test="telNum != null">
- a.tel_num = #{telNum,jdbcType=VARCHAR},
- </if>
- <if test="customerTyp != null">
- a.typ = #{customerTyp,jdbcType=INTEGER},
- </if>
- <if test="companyIntention != null">
- a.company_intention = #{companyIntention,jdbcType=VARCHAR},
- </if>
- <if test="customerName != null">
- a.customer_name = #{customerName,jdbcType=VARCHAR},
- </if>
- <if test="province != null">
- a.province = #{province,jdbcType=VARCHAR},
- </if>
- <if test="fllowSituation != null">
- a.fllow_situation = #{fllowSituation,jdbcType=VARCHAR},
- </if>
- <if test="customerStatue != null">
- a.customer_statue = #{customerStatue,jdbcType=VARCHAR},
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
-
- </select>
- </mapper>
|