|
@@ -6,6 +6,7 @@
|
|
|
<id column="id" property="id" jdbcType="INTEGER" />
|
|
|
<result column="od_no" property="od_no" jdbcType="VARCHAR" />
|
|
|
<result column="od_user_name" property="od_user_name" jdbcType="VARCHAR" />
|
|
|
+ <result column="od_user_address" property="od_user_address" jdbcType="VARCHAR" />
|
|
|
<result column="od_status" property="od_status" jdbcType="INTEGER" />
|
|
|
<result column="od_phone" property="od_phone" jdbcType="VARCHAR" />
|
|
|
<result column="od_startdate" property="od_startdate" jdbcType="DATE" />
|
|
@@ -21,6 +22,8 @@
|
|
|
<result column="od_order_amount" property="od_order_amount" jdbcType="INTEGER" />
|
|
|
<result column="od_mdj_amount" property="od_mdj_amount" jdbcType="INTEGER" />
|
|
|
<result column="od_vip_cash" property="od_vip_cash" jdbcType="INTEGER" />
|
|
|
+ <result column="od_earnestpay" property="od_earnestpay" jdbcType="INTEGER" />
|
|
|
+ <result column="od_balancepay" property="od_balancepay" jdbcType="INTEGER" />
|
|
|
<result column="od_ismdj" property="od_ismdj" jdbcType="INTEGER" />
|
|
|
<result column="od_mdjstartdate" property="od_mdjstartdate" jdbcType="DATE" />
|
|
|
<result column="od_mdjenddate" property="od_mdjenddate" jdbcType="DATE" />
|
|
@@ -30,9 +33,9 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List" >
|
|
|
- id,od_no, od_user_name,od_status,od_phone,od_startdate,od_enddate,od_mmid,od_product_id
|
|
|
+ id,od_no, od_user_name,od_user_address,od_status,od_phone,od_startdate,od_enddate,od_mmid,od_product_id,
|
|
|
od_product_item_id,od_cityid,od_contract,od_consultantid,od_introducer_phone,od_introducer_consultant,
|
|
|
- od_order_amount,od_mdj_amount,od_vip_cash,od_ismdj,od_mdjstartdate,od_mdjenddate,od_user,od_date
|
|
|
+ od_order_amount,od_mdj_amount,od_vip_cash,od_earnestpay,od_balancepay,od_ismdj,od_mdjstartdate,od_mdjenddate,od_user,od_date
|
|
|
</sql>
|
|
|
|
|
|
<!--获取所有数据-->
|
|
@@ -59,68 +62,97 @@
|
|
|
|
|
|
<select id="getAll" resultMap="BaseResultMap" >
|
|
|
select
|
|
|
- id,od_no, od_user_name,od_status,od_phone,od_startdate,od_enddate,fgetmmname(od_mmid) od_mmid,
|
|
|
- fgetpackagename(od_product_id) od_product_id
|
|
|
+ id,od_no, od_user_name,od_user_address,od_status,od_phone,od_startdate,od_enddate,od_mmid,fgetmmname(od_mmid) od_mmname,
|
|
|
+ fgetpackagename(od_product_id) od_product_name,od_product_id,
|
|
|
od_product_item_id,
|
|
|
- fgetcityname(od_cityid) cityid,od_contract,od_consultantid,od_introducer_phone,od_introducer_consultant,
|
|
|
- od_order_amount,od_mdj_amount,od_vip_cash,od_ismdj,od_mdjstartdate,od_mdjenddate,od_user,od_date
|
|
|
+ fgetcityname(od_cityid) od_cityidname, od_cityid,od_contract,od_consultantid,od_introducer_phone,od_introducer_consultant,
|
|
|
+ od_order_amount,od_mdj_amount,od_vip_cash,od_earnestpay,od_balancepay,od_ismdj,od_mdjstartdate,od_mdjenddate,od_user,od_date
|
|
|
from ys_order
|
|
|
order by id desc
|
|
|
</select>
|
|
|
|
|
|
<select id="queryYSOrder" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.order.YSOrder">
|
|
|
select
|
|
|
- id,od_no, od_user_name,od_status,od_phone,od_startdate,od_enddate,fgetmmname(od_mmid) od_mmid,
|
|
|
- fgetpackagename(od_product_id) od_product_id
|
|
|
+ id,
|
|
|
+ od_no,
|
|
|
+ od_user_name,
|
|
|
+ od_user_address,
|
|
|
+ od_status,
|
|
|
+ od_phone,
|
|
|
+ od_startdate,
|
|
|
+ od_enddate,
|
|
|
+ od_mmid,
|
|
|
+ fgetmmname (od_mmid) od_mmname,
|
|
|
+ fgetpackagename (od_product_id) od_product_name,
|
|
|
+ od_product_id,
|
|
|
od_product_item_id,
|
|
|
- fgetcityname(od_cityid) cityid,od_contract,od_consultantid,od_introducer_phone,od_introducer_consultant,
|
|
|
- od_order_amount,od_mdj_amount,od_vip_cash,od_ismdj,od_mdjstartdate,od_mdjenddate,od_user,od_date
|
|
|
+ od_cityid,
|
|
|
+ fgetbranches_name (od_cityid) od_cityidname,
|
|
|
+ od_contract,
|
|
|
+ od_consultantid,
|
|
|
+ fgetuser_name(od_consultantid) od_consultantname,
|
|
|
+ od_introducer_phone,
|
|
|
+ od_introducer_consultant,
|
|
|
+ od_order_amount,
|
|
|
+ od_mdj_amount,
|
|
|
+ od_vip_cash,
|
|
|
+ od_earnestpay,
|
|
|
+ od_balancepay,
|
|
|
+ od_ismdj,
|
|
|
+ od_mdjstartdate,
|
|
|
+ od_mdjenddate,
|
|
|
+ od_user,
|
|
|
+ fgetuser_name(od_user) od_username,
|
|
|
+ od_date
|
|
|
from ys_order
|
|
|
where 1=1
|
|
|
<if test="od_no != null and od_no != ''">
|
|
|
and od_no like "%"#{od_no,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
+ <if test="od_user_address != null and od_user_address != ''">
|
|
|
+ and od_user_address like "%"#{od_user_address,jdbcType=VARCHAR}"%"
|
|
|
+ </if>
|
|
|
<if test="od_user_name != null and od_user_name != ''">
|
|
|
- and od_user_name = #{od_user_name,jdbcType=VARCHAR}
|
|
|
+ and od_user_name like "%"#{od_user_name,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="od_startdate != null and od_startdate != ''">
|
|
|
- and od_startdate >= #{od_startdate,jdbcType=DATE}
|
|
|
+ and DATE_FORMAT(od_startdate,'%Y-%m-%d') >= DATE_FORMAT(#{od_startdate,jdbcType=DATE},'%Y-%m-%d')
|
|
|
</if>
|
|
|
<if test="od_enddate != null and od_enddate != ''">
|
|
|
- od_enddate <= #{od_enddate,jdbcType=DATE}
|
|
|
+ and DATE_FORMAT(od_enddate,'%Y-%m-%d') <= DATE_FORMAT(#{od_enddate,jdbcType=DATE},'%Y-%m-%d')
|
|
|
</if>
|
|
|
<if test="od_status != null and od_status != ''">
|
|
|
- and od_status = #{od_status,jdbcType=VARCHAR}
|
|
|
+ and od_status = #{od_status,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_phone != null and od_phone != ''">
|
|
|
and od_phone = #{od_phone,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="od_mmid != null and od_mmid != ''">
|
|
|
- and od_mmid = #{od_mmid,jdbcType=VARCHAR}
|
|
|
+ and od_mmid = #{od_mmid,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_product_id != null and od_product_id != ''">
|
|
|
- and od_product_id = #{od_product_id,jdbcType=VARCHAR}
|
|
|
+ and od_product_id = #{od_product_id,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_product_item_id != null and od_product_item_id != ''">
|
|
|
- and od_product_item_id = #{od_product_item_id,jdbcType=VARCHAR}
|
|
|
+ and od_product_item_id = #{od_product_item_id,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_cityid != null and od_cityid != ''">
|
|
|
- and od_cityid = #{od_cityid,jdbcType=VARCHAR}
|
|
|
+ and od_cityid = #{od_cityid,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_contract != null and od_contract != ''">
|
|
|
- and od_contract = #{od_contract,jdbcType=VARCHAR}
|
|
|
+ and od_contract like "%"#{od_contract,jdbcType=VARCHAR}"%"
|
|
|
</if>
|
|
|
<if test="od_consultantid != null and od_consultantid != ''">
|
|
|
- and od_consultantid = #{od_consultantid,jdbcType=VARCHAR}
|
|
|
+ and od_consultantid = #{od_consultantid,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_introducer_phone != null and od_introducer_phone != ''">
|
|
|
and od_introducer_phone = #{od_introducer_phone,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="od_ismdj != null and od_ismdj != ''">
|
|
|
- and od_ismdj = #{od_ismdj,jdbcType=VARCHAR}
|
|
|
+ and od_ismdj = #{od_ismdj,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="od_user != null and od_user != ''">
|
|
|
- and od_user = #{od_user,jdbcType=VARCHAR}
|
|
|
+ and od_user = #{od_user,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
order by id desc
|
|
|
</select>
|
|
@@ -132,6 +164,42 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectByOdNo" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
+ select
|
|
|
+ od_no,
|
|
|
+ od_user_name,
|
|
|
+ od_user_address,
|
|
|
+ od_status,
|
|
|
+ od_phone,
|
|
|
+ od_startdate,
|
|
|
+ od_enddate,
|
|
|
+ od_mmid,
|
|
|
+ fgetmmname (od_mmid) od_mmname,
|
|
|
+ fgetpackagename (od_product_id) od_product_name,
|
|
|
+ od_product_id,
|
|
|
+ od_product_item_id,
|
|
|
+ od_cityid,
|
|
|
+ fgetbranches_name (od_cityid) od_cityidname,
|
|
|
+ od_contract,
|
|
|
+ od_consultantid,
|
|
|
+ fgetuser_name(od_consultantid) od_consultantname,
|
|
|
+ od_introducer_phone,
|
|
|
+ od_introducer_consultant,
|
|
|
+ od_order_amount,
|
|
|
+ od_mdj_amount,
|
|
|
+ od_vip_cash,
|
|
|
+ od_earnestpay,
|
|
|
+ od_balancepay,
|
|
|
+ od_ismdj,
|
|
|
+ od_mdjstartdate,
|
|
|
+ od_mdjenddate,
|
|
|
+ od_user,
|
|
|
+ fgetuser_name(od_user) od_username,
|
|
|
+ od_date
|
|
|
+ from ys_order
|
|
|
+ where od_no = #{od_no,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from ys_order
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
@@ -147,6 +215,9 @@
|
|
|
<if test="od_user_name != null" >
|
|
|
od_user_name,
|
|
|
</if>
|
|
|
+ <if test="od_user_address != null" >
|
|
|
+ od_user_address,
|
|
|
+ </if>
|
|
|
<if test="od_status != null" >
|
|
|
od_status,
|
|
|
</if>
|
|
@@ -192,7 +263,12 @@
|
|
|
<if test="od_vip_cash != null" >
|
|
|
od_vip_cash,
|
|
|
</if>
|
|
|
-
|
|
|
+ <if test="od_earnestpay != null" >
|
|
|
+ od_earnestpay,
|
|
|
+ </if>
|
|
|
+ <if test="od_balancepay != null" >
|
|
|
+ od_balancepay,
|
|
|
+ </if>
|
|
|
<if test="od_ismdj != null" >
|
|
|
od_ismdj,
|
|
|
</if>
|
|
@@ -216,6 +292,9 @@
|
|
|
<if test="od_user_name != null" >
|
|
|
#{od_user_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="od_user_address != null" >
|
|
|
+ #{od_user_address,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="od_status != null" >
|
|
|
#{od_status,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -228,9 +307,6 @@
|
|
|
<if test="od_enddate != null" >
|
|
|
#{od_enddate,jdbcType=DATE},
|
|
|
</if>
|
|
|
- <if test="cm_phone != null" >
|
|
|
- #{cm_phone,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
<if test="od_mmid != null" >
|
|
|
#{od_mmid,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -264,6 +340,12 @@
|
|
|
<if test="od_vip_cash != null" >
|
|
|
#{od_vip_cash,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="od_earnestpay != null" >
|
|
|
+ #{od_earnestpay,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="od_balancepay != null" >
|
|
|
+ #{od_balancepay,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
<if test="od_ismdj != null" >
|
|
|
#{od_ismdj,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -274,7 +356,7 @@
|
|
|
#{od_mdjenddate,jdbcType=DATE},
|
|
|
</if>
|
|
|
<if test="od_user != null" >
|
|
|
- #{od_user,jdbcType=VARCHAR},
|
|
|
+ #{od_user,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="od_date != null" >
|
|
|
#{od_date,jdbcType=VARCHAR}
|
|
@@ -292,6 +374,9 @@
|
|
|
<if test="od_user_name != null" >
|
|
|
od_user_name = #{od_user_name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="od_user_address != null" >
|
|
|
+ od_user_address = #{od_user_address,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
<if test="od_status != null" >
|
|
|
od_status = #{od_status,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -322,9 +407,6 @@
|
|
|
<if test="od_contract != null" >
|
|
|
od_contract = #{od_contract,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="packageid != null" >
|
|
|
- packageid = #{packageid,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
<if test="od_consultantid != null" >
|
|
|
od_consultantid = #{od_consultantid,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -343,6 +425,12 @@
|
|
|
<if test="od_vip_cash != null" >
|
|
|
od_vip_cash = #{od_vip_cash,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
+ <if test="od_earnestpay != null" >
|
|
|
+ od_earnestpay = #{od_earnestpay,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="od_balancepay != null" >
|
|
|
+ od_balancepay = #{od_balancepay,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
<if test="od_ismdj != null" >
|
|
|
od_ismdj = #{od_ismdj,jdbcType=INTEGER},
|
|
|
</if>
|
|
@@ -353,7 +441,7 @@
|
|
|
od_mdjenddate = #{od_mdjenddate,jdbcType=DATE},
|
|
|
</if>
|
|
|
<if test="od_user != null" >
|
|
|
- od_user = #{od_user,jdbcType=INTEGER}
|
|
|
+ od_user = #{od_user,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="od_date != null" >
|
|
|
od_date = #{od_date,jdbcType=VARCHAR}
|
|
@@ -362,4 +450,27 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
+ <select id="getAESeq" resultType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from ys_order
|
|
|
+ where date_format(od_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateYsOrderStatus" parameterType="com.ygj.yuemum.domain.order.YSOrder" >
|
|
|
+ update ys_order
|
|
|
+ <set >
|
|
|
+ <if test="od_status != null" >
|
|
|
+ od_status = #{od_status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="od_earnestpay != null" >
|
|
|
+ od_earnestpay = #{od_earnestpay,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="od_balancepay != null" >
|
|
|
+ od_balancepay = #{od_balancepay,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where od_no = #{od_no,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
</mapper>
|