123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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.ygj.yuemum.dao.customer.CustomerBookingDao" >
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.customer.CustomerBooking" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="bk_phone" property="bk_phone" jdbcType="VARCHAR" />
- <result column="bk_duedate" property="bk_duedate" jdbcType="DATE" />
- <result column="bk_date" property="bk_date" jdbcType="DATE" />
- <result column="bk_type" property="bk_type" jdbcType="INTEGER" />
- <result column="bk_desc" property="bk_desc" jdbcType="VARCHAR" />
- <result column="bk_typedesc" property="bk_typedesc" jdbcType="VARCHAR" />
- <result column="bk_introducer_phone" property="bk_introducer_phone" jdbcType="VARCHAR" />
- <result column="bk_introducer_consultant" property="bk_introducer_consultant" jdbcType="VARCHAR" />
- <result column="bk_branches_id" property="bk_branches_id" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,bk_branches_id
- </sql>
- <!-- 此处添加查询信息-->
- <select id="selectCustomerBooking" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,bk_introducer_phone,bk_introducer_consultant,bk_branches_id
- from customer_booking
- where bk_phone = #{bk_phone,jdbcType=VARCHAR}
- order by bk_date desc
- </select>
- <select id="selectAll" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.customer.CustomerBooking">
- select
- id, bk_phone,bk_duedate,bk_date,bk_type,bk_desc,bk_introducer_phone,bk_introducer_consultant,bk_branches_id
- case bk_type when 1 then '套餐预约' WHEN 2 then '月嫂预约' WHEN 3 then '设备租赁' WHEN 4 then '顾问预约' WHEN 5 then '设备归还' End as bk_typedesc
- from customer_booking
- where 1=1
- <if test="bk_phone != null and bk_phone != ''">
- and bk_phone = #{bk_phone,jdbcType=INTEGER}
- </if>
- <if test="bk_date != null and bk_date != ''">
- and bk_date = #{bk_date,jdbcType=INTEGER}
- </if>
- <if test="bk_type != null and bk_type != ''">
- and bk_type = #{bk_type,jdbcType=INTEGER}
- </if>
- <if test="bk_introducer_phone != null and bk_introducer_phone != ''">
- and bk_introducer_phone = #{bk_introducer_phone,jdbcType=INTEGER}
- </if>
- <if test="bk_introducer_consultant != null and bk_introducer_consultant != ''">
- and bk_introducer_consultant like "%"#{bk_introducer_consultant,jdbcType=VARCHAR}"%"
- </if>
- <if test="bk_type != null and bk_type != ''">
- and bk_type = #{bk_type,jdbcType=INTEGER}
- </if>
- <if test="bk_duedate != null and bk_duedate != ''">
- and bk_duedate = #{bk_duedate,jdbcType=INTEGER}
- </if>
- order by 1 desc
- </select>
- <select id="checkBooking" resultType="java.lang.Integer" parameterType="com.ygj.yuemum.domain.customer.CustomerBooking">
- select
- count(1)
- from customer_booking
- where 1=1
- <if test="bk_phone != null and bk_phone != ''">
- and bk_phone = #{bk_phone,jdbcType=INTEGER}
- </if>
- <if test="bk_date != null and bk_date != ''">
- and bk_date = #{bk_date,jdbcType=INTEGER}
- </if>
- <if test="bk_type != null and bk_type != ''">
- and bk_type = #{bk_type,jdbcType=INTEGER}
- </if>
- </select>
- <!-- 插入一条培训信息 -->
- <insert id="insertCustomerBooking" parameterType="com.ygj.yuemum.domain.customer.CustomerBooking" >
- insert into customer_booking
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="bk_phone != null" >
- bk_phone,
- </if>
- <if test="bk_duedate != null" >
- bk_duedate,
- </if>
- <if test="bk_date != null" >
- bk_date,
- </if>
- <if test="bk_type != null" >
- bk_type,
- </if>
- <if test="bk_introducer_phone != null" >
- bk_introducer_phone,
- </if>
- <if test="bk_introducer_consultant != null" >
- bk_introducer_consultant,
- </if>
- <if test="bk_desc != null" >
- bk_desc,
- </if>
- <if test="bk_branches_id != null" >
- bk_branches_id
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="bk_phone != null" >
- #{bk_phone,jdbcType=VARCHAR},
- </if>
- <if test="bk_duedate != null" >
- #{bk_duedate,jdbcType=DATE},
- </if>
- <if test="bk_date != null" >
- #{bk_date,jdbcType=DATE},
- </if>
- <if test="bk_type != null" >
- #{bk_type,jdbcType=INTEGER},
- </if>
- <if test="bk_introducer_phone != null" >
- #{bk_introducer_phone,jdbcType=INTEGER},
- </if>
- <if test="bk_introducer_consultant != null" >
- #{bk_introducer_consultant,jdbcType=INTEGER},
- </if>
- <if test="bk_desc != null" >
- #{bk_desc,jdbcType=VARCHAR},
- </if>
- <if test="bk_branches_id != null" >
- #{bk_branches_id,jdbcType=INTEGER}
- </if>
- </trim>
- </insert>
- </mapper>
|