123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367 |
- <?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.platform.yijia.dao.CustomerManagerMapper">
- <!--客户信息返回结果-->
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.CustomerManage">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="member_id" jdbcType="VARCHAR" property="memberId" />
- <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
- <result column="commend_man" jdbcType="VARCHAR" property="commendMan" />
- <result column="member_grade" jdbcType="VARCHAR" property="memberGrade" />
- <result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
- <result column="car_number" jdbcType="VARCHAR" property="carNumber" />
- <result column="balance" jdbcType="DECIMAL" property="balance" />
- <result column="integral" jdbcType="INTEGER" property="integral" />
- <result column="special_car_type" jdbcType="VARCHAR" property="specialCarType" />
- <result column="regtime" jdbcType="TIMESTAMP" property="regtime" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="station_name" jdbcType="VARCHAR" property="stationName"/>
- <result column="cy_grade" jdbcType="VARCHAR" property="cyGrade" />
- <result column="qy_grade" jdbcType="VARCHAR" property="qyGrade" />
- <result column="cy_liters" jdbcType="DECIMAL" property="cyLiters"/>
- <result column="qy_liters" jdbcType="DECIMAL" property="qyLiters" />
- <result column="cy_amt" jdbcType="DECIMAL" property="cyAmt" />
- <result column="qy_amt" jdbcType="DECIMAL" property="qyAmt" />
- <result column="blog_openid" jdbcType="VARCHAR" property="blogOpenid" />
- <result column="mina_openid" jdbcType="VARCHAR" property="minaOpenid" />
- <result column="blog_user_id" jdbcType="INTEGER" property="blogUserId" />
- <result column="mina_user_id" jdbcType="INTEGER" property="minaUserId"/>
- <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
- <result column="grade" jdbcType="VARCHAR" property="grade" />
- <result column="liters" jdbcType="DECIMAL" property="liters" />
- <result column="amt" jdbcType="DECIMAL" property="amt" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="group_id" jdbcType="INTEGER" property="groupId" />
- </resultMap>
- <!--集团客户信息返回结果-->
- <resultMap id="customerGroupBaseResultMap" type="com.platform.yijia.pojo.CustomerGroup">
- <result column="customer_id" jdbcType="VARCHAR" property="customerId" />
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
- <result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
- <result column="group_id" jdbcType="INTEGER" property="groupId" />
- </resultMap>
- <!--查询集团客户列-->
- <sql id="Base_Column_List_CustomerGroup">
- customer_id, union_id, phone_number, group_id
- </sql>
- <!--查询-->
- <sql id="Base_Column_List">
- id, member_id, customer_name, commend_man, member_grade, phone_number, car_number, balance,
- integral, special_car_type, regtime, station_id, station_name, cy_grade, qy_grade, cy_liters,
- qy_liters, cy_amt, qy_amt, blog_openid, mina_openid, blog_user_id, mina_user_id, oil_name, grade,
- liters, amt, union_id, group_id
- </sql>
- <!--获取客户信息-->
- <!-- <select id="selectCustomerMannagerInfo" parameterType="com.platform.yijia.pojo.CustomerManage" resultMap="BaseResultMap">-->
- <!-- SELECT-->
- <!-- <include refid="Base_Column_List"/>-->
- <!-- FROM-->
- <!-- customer_manage-->
- <!-- <where>-->
- <!-- <if test="stationId !=null">-->
- <!-- station_id = #{stationId}-->
- <!-- </if>-->
- <!-- <if test="unionId !=null">-->
- <!-- AND union_id = #{unionId}-->
- <!-- </if>-->
- <!-- </where>-->
- <!-- </select>-->
- <!--查询集团下客户信息-->
- <select id="selectCustomerGroup" parameterType="com.platform.yijia.pojo.CustomerGroup" resultMap="customerGroupBaseResultMap">
- SELECT
- <include refid="Base_Column_List_CustomerGroup"/>
- FROM
- customer_group
- <where>
- <if test="unionId !=null and unionId !=''">
- union_id = #{unionId}
- </if>
- <if test="groupId !=null">
- AND group_id = #{groupId}
- </if>
- </where>
- </select>
- <!--插入集团客户信息-->
- <insert id="insertCustomerGroup" parameterType="com.platform.yijia.pojo.CustomerGroup">
- INSERT
- customer_group
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="customerId !=null">
- customer_id,
- </if>
- <if test="unionId !=null">
- union_id,
- </if>
- <if test="phoneNumber !=null">
- phone_number,
- </if>
- <if test="groupId !=null">
- group_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="customerId !=null">
- #{customerId},
- </if>
- <if test="unionId !=null">
- #{unionId},
- </if>
- <if test="phoneNumber !=null">
- #{phoneNumber},
- </if>
- <if test="groupId !=null">
- #{groupId},
- </if>
- </trim>
- </insert>
- <!--查询油站客户信息-->
- <select id="getCustomerManageInfo" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.CustomerManage">
- SELECT
- <include refid="Base_Column_List" />
- FROM
- customer_manage
- <where>
- <if test="stationId !=null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="phoneNumber !=null and phoneNumber !='' ">
- AND phone_number = #{phoneNumber}
- </if>
- <if test="oilName !=null and oilName !=''">
- AND oil_name = #{oilName}
- </if>
- <if test="minaOpenid !=null and minaOpenid !=''">
- AND mina_openid = #{minaOpenid}
- </if>
- <if test="unionId !=null and unionId !=''">
- AND union_id = #{unionId}
- </if>
- </where>
- </select>
- <!-- 更新客户表 -->
- <update id="updateCustomerInfo" parameterType="com.platform.yijia.pojo.CustomerManage">
- UPDATE
- customer_manage
- <set>
- <if test="memberId !=null ">
- member_id = #{memberId},
- </if>
- <if test="memberGrade !=null ">
- member_grade = #{memberGrade},
- </if>
- <if test="customerName !=null ">
- customer_name = #{customerName},
- </if>
- <if test="phoneNumber !=null ">
- phone_number = #{phoneNumber},
- </if>
- <if test="regtime !=null ">
- regtime = #{regtime},
- </if>
- <if test="stationName !=null ">
- station_name = #{stationName},
- </if>
- <if test="oilName !=null ">
- oil_name = #{oilName},
- </if>
- <if test="liters !=null ">
- liters = #{liters},
- </if>
- <if test="amt !=null ">
- amt = #{amt},
- </if>
- <if test="grade !=null ">
- grade = #{grade},
- </if>
- <if test="integral !=null ">
- integral = #{integral},
- </if>
- </set>
- <where>
- <if test="stationId != null and stationId !='' ">
- station_id = #{stationId}
- </if>
- <if test="phoneNumber !=null and phoneNumber !='' ">
- AND phone_number = #{phoneNumber}
- </if>
- <if test="oilName !=null and oilName !='' ">
- AND oil_name = #{oilName}
- </if>
- </where>
- </update>
- <!-- 插入客户表 -->
- <insert id="insertCustomerInfo" parameterType="com.platform.yijia.pojo.CustomerManage">
- INSERT INTO customer_manage
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="memberId !=null ">
- member_id,
- </if>
- <if test="customerName !=null ">
- customer_name,
- </if>
- <if test="commendMan !=null ">
- commend_man,
- </if>
- <if test="memberGrade !=null ">
- member_grade,
- </if>
- <if test="phoneNumber !=null ">
- phone_number,
- </if>
- <if test="carNumber !=null ">
- car_number,
- </if>
- <if test="balance !=null ">
- balance,
- </if>
- <if test="integral !=null ">
- integral,
- </if>
- <if test="specialCarType !=null ">
- specialCarType,
- </if>
- <if test="regtime !=null ">
- regtime,
- </if>
- <if test="stationId !=null ">
- station_id,
- </if>
- <if test="stationName !=null ">
- station_name,
- </if>
- <if test="oilName !=null ">
- oil_name,
- </if>
- <if test="liters !=null ">
- liters,
- </if>
- <if test="amt !=null ">
- amt,
- </if>
- <if test="cyGrade !=null ">
- cy_grade,
- </if>
- <if test="qyGrade !=null ">
- qy_grade,
- </if>
- <if test="blogOpenid !=null ">
- blog_openid,
- </if>
- <if test="minaOpenid !=null ">
- mina_openid,
- </if>
- <if test="blogUserId !=null ">
- blog_user_id,
- </if>
- <if test="minaUserId !=null ">
- mina_user_id,
- </if>
- <if test="grade !=null ">
- grade,
- </if>
- <if test="unionId !=null and unionId !=''">
- union_id,
- </if>
- <if test="groupId !=null and groupId !=''">
- group_id
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="memberId !=null ">
- #{memberId},
- </if>
- <if test="customerName !=null ">
- #{customerName},
- </if>
- <if test="commendMan !=null ">
- #{commendMan},
- </if>
- <if test="memberGrade !=null ">
- #{memberGrade},
- </if>
- <if test="phoneNumber !=null ">
- #{phoneNumber},
- </if>
- <if test="carNumber !=null ">
- #{carNumber},
- </if>
- <if test="balance !=null ">
- #{balance},
- </if>
- <if test="integral !=null ">
- #{integral},
- </if>
- <if test="specialCarType !=null ">
- #{specialCarType},
- </if>
- <if test="regtime !=null ">
- #{regtime},
- </if>
- <if test="stationId !=null ">
- #{stationId, jdbcType=INTEGER},
- </if>
- <if test="stationName !=null ">
- #{stationName, jdbcType=VARCHAR},
- </if>
- <if test="oilName !=null ">
- #{oilName},
- </if>
- <if test="liters !=null ">
- #{liters},
- </if>
- <if test="amt !=null ">
- #{amt},
- </if>
- <if test="cyGrade !=null ">
- #{cyGrade},
- </if>
- <if test="qyGrade !=null ">
- #{qyGrade},
- </if>
- <if test="blogOpenid !=null ">
- #{blogOpenid},
- </if>
- <if test="minaOpenid !=null ">
- #{minaOpenid, jdbcType=VARCHAR},
- </if>
- <if test="blogUserId !=null ">
- #{blogUserId, jdbcType=INTEGER},
- </if>
- <if test="minaUserId !=null ">
- #{minaUserId, jdbcType=INTEGER},
- </if>
- <if test="grade !=null ">
- #{grade, jdbcType=VARCHAR},
- </if>
- <if test="unionId !=null and unionId !=''">
- #{unionId, jdbcType=VARCHAR},
- </if>
- <if test="groupId !=null and groupId !=''">
- #{groupId, jdbcType=INTEGER}
- </if>
- </trim>
- </insert>
- </mapper>
|