| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <?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.yaorong.eai.web.detect.mapper.DetectInfoMapper">
- <resultMap id="BaseResultMap" type="com.yaorong.eai.web.detect.vo.DetectInfo">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="phone" jdbcType="VARCHAR" property="phone"/>
- <result column="source_code" jdbcType="VARCHAR" property="sourceCode"/>
- <result column="score" jdbcType="INTEGER" property="score"/>
- <result column="ave_time" jdbcType="REAL" property="aveTime"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
- <result column="totalRight" jdbcType="INTEGER" property="score"/>
- <result column="totalWrong" jdbcType="INTEGER" property="score"/>
- <result column="totalTimeout" jdbcType="INTEGER" property="score"/>
- <result column="totalQuestion" jdbcType="INTEGER" property="score"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, phone, source_code, score, ave_time, create_time, create_by
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from ea_detect_info
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from ea_detect_info
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo">
- insert into ea_detect_info (id, phone, source_code,
- score, ave_time, create_time,
- create_by)
- values (#{id,jdbcType=BIGINT}, #{phone,jdbcType=VARCHAR}, #{sourceCode,jdbcType=VARCHAR},
- #{score,jdbcType=INTEGER}, #{aveTime,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP},
- #{createBy,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo" useGeneratedKeys="true"
- keyProperty="id">
- insert into ea_detect_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="sourceCode != null">
- source_code,
- </if>
- <if test="score != null">
- score,
- </if>
- <if test="aveTime != null">
- ave_time,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="createBy != null">
- create_by,
- </if>
- <if test="hospitalId != null">
- hospital_id,
- </if>
- <if test="hospitalName != null">
- hospital_name,
- </if>
- <if test="totalRight != null">
- total_right,
- </if>
- <if test="totalWrong != null">
- total_wrong,
- </if>
- <if test="totalTimeout != null">
- total_timeout,
- </if>
- <if test="totalQuestion != null">
- total_question,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="sourceCode != null">
- #{sourceCode,jdbcType=VARCHAR},
- </if>
- <if test="score != null">
- #{score,jdbcType=INTEGER},
- </if>
- <if test="aveTime != null">
- #{aveTime,jdbcType=REAL},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createBy != null">
- #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="hospitalId != null">
- #{hospitalId,jdbcType=VARCHAR},
- </if>
- <if test="hospitalName != null">
- #{hospitalName,jdbcType=VARCHAR},
- </if>
- <if test="totalRight != null">
- #{totalRight,jdbcType=INTEGER},
- </if>
- <if test="totalWrong != null">
- #{totalWrong,jdbcType=INTEGER},
- </if>
- <if test="totalTimeout != null">
- #{totalTimeout,jdbcType=INTEGER},
- </if>
- <if test="totalQuestion != null">
- #{totalQuestion,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo">
- update ea_detect_info
- <set>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="sourceCode != null">
- source_code = #{sourceCode,jdbcType=VARCHAR},
- </if>
- <if test="score != null">
- score = #{score,jdbcType=INTEGER},
- </if>
- <if test="aveTime != null">
- ave_time = #{aveTime,jdbcType=REAL},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createBy != null">
- create_by = #{createBy,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo">
- update ea_detect_info
- set phone = #{phone,jdbcType=VARCHAR},
- source_code = #{sourceCode,jdbcType=VARCHAR},
- score = #{score,jdbcType=INTEGER},
- ave_time = #{aveTime,jdbcType=REAL},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- create_by = #{createBy,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <select id="queryReportByPhone" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo" resultType="map">
- select score, ave_time, create_time, total_right, total_wrong, total_timeout from ea_detect_info y
- where y.phone=#{phone,jdbcType=VARCHAR}
- <if test="null != sdate">
- <![CDATA[ and DATE_FORMAT(y.create_time,'%Y-%m-%d') >= #{sdate} ]]>
- </if>
- <if test="null != edate">
- <![CDATA[ and DATE_FORMAT(y.create_time,'%Y-%m-%d') <= #{edate} ]]>
- </if>
- ORDER BY y.create_time desc
- <if test="0 != endrow">
- limit #{startrow,jdbcType=INTEGER}, #{pageLimit,jdbcType=INTEGER}
- </if>
- </select>
- <select id="countReportByPhone" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo" resultType="integer">
- select count(1) from ea_detect_info y
- where y.phone=#{phone,jdbcType=VARCHAR}
- <if test="null != sdate">
- <![CDATA[ and DATE_FORMAT(y.create_time,'%Y-%m-%d') >= #{sdate} ]]>
- </if>
- <if test="null != edate">
- <![CDATA[ and DATE_FORMAT(y.create_time,'%Y-%m-%d') <= #{edate} ]]>
- </if>
- </select>
- <select id="queryLastReport" parameterType="com.yaorong.eai.web.detect.vo.DetectInfo" resultMap="BaseResultMap">
- select * from ea_detect_info where phone=#{phone,jdbcType=VARCHAR} order by create_time desc limit 1
- </select>
- </mapper>
|