1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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.wxmini.WXMMUserSearchDao">
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.wxmini.WXMMUserSearch">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="wmu_openid" property="wmu_openid" jdbcType="VARCHAR"/>
- <result column="wmu_phone" property="wmu_phone" jdbcType="VARCHAR"/>
- <result column="wmu_city" property="wmu_city" jdbcType="VARCHAR"/>
- <result column="wmu_date" property="wmu_date" jdbcType="DATE"/>
- </resultMap>
- <!--获取所有数据-->
- <select id="getWXMMUserSearchs" resultType="com.ygj.yuemum.domain.wxmini.WXMMUserSearch" parameterType="java.lang.String">
- select
- *
- from wx_mm_user_search
- where wmu_openid = #{wmu_openid,jdbcType=VARCHAR}
- order by id asc
- </select>
- <select id="queryWXMMUserSearchs" resultType="com.ygj.yuemum.domain.wxmini.WXMMUserSearch" parameterType="com.ygj.yuemum.domain.wxmini.WXMMUserSearch">
- select
- id,
- wmu_openid,
- wmu_phone,
- wmu_city,
- wmu_date,
- fgetbranches_name(wmu_city) wmu_city_name
- from wx_mm_user_search
- where 1=1
- <if test="wmu_openid != null and wmu_openid != ''">
- and wmu_openid like "%"#{wmu_openid,jdbcType=VARCHAR}"%"
- </if>
- <if test="wmu_phone != null and wmu_phone != ''">
- and wmu_phone = #{wmu_phone,jdbcType=INTEGER}
- </if>
- <if test="wmu_city != null and wmu_city != ''">
- and wmu_city = #{wmu_city,jdbcType=INTEGER}
- </if>
- <if test="wmu_date != null and wmu_date != ''">
- and DATE_FORMAT(wmu_date,'%Y-%m-%d') = DATE_FORMAT(#{wmu_date,jdbcType=DATE},'%Y-%m-%d')
- </if>
- order by id desc
- </select>
- <insert id="insertWXMMUserSearch" parameterType="com.ygj.yuemum.domain.wxmini.WXMMUserSearch" >
- insert into wx_mm_user_search
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="wmu_openid != null" >
- wmu_openid,
- </if>
- <if test="wmu_phone != null" >
- wmu_phone,
- </if>
- <if test="wmu_city != null" >
- wmu_city,
- </if>
- <if test="wmu_date != null" >
- wmu_date
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="wmu_openid != null" >
- #{wmu_openid,jdbcType=VARCHAR},
- </if>
- <if test="wmu_phone != null" >
- #{wmu_phone,jdbcType=VARCHAR},
- </if>
- <if test="wmu_city != null" >
- #{wmu_city,jdbcType=VARCHAR},
- </if>
- <if test="wmu_date != null" >
- #{wmu_date,jdbcType=DATE}
- </if>
- </trim>
- </insert>
- <select id="getWXMMUserSearchId" resultType="java.lang.Integer" >
- SELECT auto_increment
- FROM information_schema.tables
- where table_schema="yuemum"
- and table_name="wx_mm_user_search";
- </select>
- </mapper>
|