|
@@ -671,6 +671,223 @@
|
|
|
</where>
|
|
|
</update>
|
|
|
|
|
|
+ <!-- 判断客户表是否已存在-->
|
|
|
+ <select id="isExistCustomer" parameterType="com.platform.yijia.pojo.CustomerManage" resultType="com.platform.yijia.pojo.CustomerManage">
|
|
|
+ SELECT
|
|
|
+ id AS id,
|
|
|
+ member_id AS memberId,
|
|
|
+ member_grade AS memberGrade,
|
|
|
+ phone_number AS phoneNumber,
|
|
|
+ regtime AS regtime,
|
|
|
+ station_name AS stationName,
|
|
|
+ cy_liters AS cyLiters,
|
|
|
+ qy_liters AS qyLiters,
|
|
|
+ cy_amt AS cyAmt,
|
|
|
+ qy_amt AS qyAmt
|
|
|
+ FROM
|
|
|
+ customer_manage
|
|
|
+ <where>
|
|
|
+ <if test="blogOpenid !=null and blogOpenid !='' ">
|
|
|
+ blog_openid = #{blogOpenid}
|
|
|
+ </if>
|
|
|
+ <if test="minaOpenid !=null and minaOpenid !='' ">
|
|
|
+ AND mina_openid = #{minaOpenid}
|
|
|
+ </if>
|
|
|
+ <if test="stationId !=null and stationId !='' ">
|
|
|
+ AND station_id = #{stationId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 更新客户表 -->
|
|
|
+ <update id="updateCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
|
|
|
+ UPDATE
|
|
|
+ customer_manage
|
|
|
+ <set>
|
|
|
+ <if test="memberGrade !=null ">
|
|
|
+ member_grade = #{memberGrade},
|
|
|
+ </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="cyLiters !=null ">
|
|
|
+ cy_liters = #{cyLiters},
|
|
|
+ </if>
|
|
|
+ <if test="qyLiters !=null ">
|
|
|
+ qy_liters = #{qyLiters},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <where>
|
|
|
+ <if test="blogOpenid !=null and blogOpenid !='' ">
|
|
|
+ blog_openid = #{blogOpenid}
|
|
|
+ </if>
|
|
|
+ <if test="minaOpenid !=null and minaOpenid !='' ">
|
|
|
+ AND mina_openid = #{minaOpenid}
|
|
|
+ </if>
|
|
|
+ <if test="stationId !=null and stationId !='' ">
|
|
|
+ AND station_id = #{stationId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 插入客户表 -->
|
|
|
+ <insert id="insertCustomer" parameterType="com.platform.yijia.pojo.CustomerManage">
|
|
|
+ INSERT INTO
|
|
|
+ <trim prefix="values (" 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="cyGrade !=null ">
|
|
|
+ cy_grade,
|
|
|
+ </if>
|
|
|
+ <if test="qyGrade !=null ">
|
|
|
+ qy_grade,
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="cyLiters !=null ">
|
|
|
+ cy_liters,
|
|
|
+ </if>
|
|
|
+ <if test="qyLiters !=null ">
|
|
|
+ qy_liters
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="cyAmt !=null ">
|
|
|
+ cy_amt,
|
|
|
+ </if>
|
|
|
+ <if test="qyAmt !=null ">
|
|
|
+ qy_amt,
|
|
|
+ </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>
|
|
|
+
|
|
|
+ </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},
|
|
|
+ </if>
|
|
|
+ <if test="stationName !=null ">
|
|
|
+ #{stationName},
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="cyGrade !=null ">
|
|
|
+ #{cyGrade},
|
|
|
+ </if>
|
|
|
+ <if test="qyGrade !=null ">
|
|
|
+ #{qyGrade},
|
|
|
+ </if>
|
|
|
+ <if test="cyLiters !=null ">
|
|
|
+ #{cyLiters},
|
|
|
+ </if>
|
|
|
+ <if test="qyLiters !=null ">
|
|
|
+ #{qyLiters},
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="cyAmt !=null ">
|
|
|
+ #{cyAmt},
|
|
|
+ </if>
|
|
|
+ <if test="qyAmt !=null ">
|
|
|
+ #{qyAmt},
|
|
|
+ </if>
|
|
|
+ <if test="blogOpenid !=null ">
|
|
|
+ #{blogOpenid},
|
|
|
+ </if>
|
|
|
+ <if test="minaOpenid !=null ">
|
|
|
+ #{minaOpenid},
|
|
|
+ </if>
|
|
|
+ <if test="blogUserId !=null ">
|
|
|
+ #{blogUserId},
|
|
|
+ </if>
|
|
|
+ <if test="minaUserId !=null ">
|
|
|
+ #{minaUserId}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
<!--
|