12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?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.WXMMUserSearchDetailDao">
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.wxmini.WXMMUserSearchDetail">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="wmu_id" property="wmu_id" jdbcType="VARCHAR"/>
- <result column="wmud_phone" property="wmud_phone" jdbcType="VARCHAR"/>
- <result column="wmud_qid" property="wmud_qid" jdbcType="VARCHAR"/>
- <result column="wmud_aid" property="wmud_aid" jdbcType="DATE"/>
- <result column="wmud_value" property="wmud_value" jdbcType="VARCHAR"/>
- </resultMap>
- <!--获取所有数据-->
- <select id="getWXMMUserSearchDetails" resultType="com.ygj.yuemum.domain.wxmini.WXMMUserSearchDetail" parameterType="java.lang.String">
- select
- *
- from wx_mm_user_search_detail
- where wmud_phone = #{wmud_phone,jdbcType=VARCHAR}
- order by id asc
- </select>
- <select id = "getWXMMUserSearchDetailByQID" resultType="com.ygj.yuemum.domain.wxmini.WXMMUserSearchDetail" parameterType="java.lang.Integer">
- SELECT
- wx_mm_user_search_detail.wmu_id,
- wx_mm_user_search_detail.wmud_phone,
- wx_mm_user_search_detail.wmud_qid,
- wx_mm_search_question.wsq_name,
- wx_mm_user_search_detail.wmud_aid,
- CASE wx_mm_search_question.wsq_type
- WHEN 2 THEN
- wx_mm_search_answer.wma_desc
- WHEN 1 THEN
- CONCAT(wx_mm_search_answer.wma_desc,':',wx_mm_user_search_detail.wmud_value)
- END as returnvalue
- FROM
- wx_mm_user_search_detail
- LEFT JOIN wx_mm_search_question ON wx_mm_user_search_detail.wmud_qid = wx_mm_search_question.id
- LEFT JOIN wx_mm_search_answer ON wx_mm_user_search_detail.wmud_aid = wx_mm_search_answer.id
- WHERE
- wmu_id = #{wmu_id,jdbcType=INTEGER}
- ORDER BY
- wmud_qid ASC,
- wmud_aid ASC
- </select>
- <insert id="insertWXMMUserSearchDetail" parameterType="com.ygj.yuemum.domain.wxmini.WXMMUserSearchDetail" >
- insert into wx_mm_user_search_detail
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="wmu_id != null" >
- wmu_id,
- </if>
- <if test="wmud_phone != null" >
- wmud_phone,
- </if>
- <if test="wmud_qid != null" >
- wmud_qid,
- </if>
- <if test="wmud_aid != null" >
- wmud_aid,
- </if>
- <if test="wmud_value != null" >
- wmud_value
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="wmu_id != null" >
- #{wmu_id,jdbcType=INTEGER},
- </if>
- <if test="wmud_phone != null" >
- #{wmud_phone,jdbcType=VARCHAR},
- </if>
- <if test="wmud_qid != null" >
- #{wmud_qid,jdbcType=INTEGER},
- </if>
- <if test="wmud_aid != null" >
- #{wmud_aid,jdbcType=INTEGER},
- </if>
- <if test="wmud_value != null" >
- #{wmud_value,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- </mapper>
|