BindInfoMapper.xml 1.74 KB
Newer Older
xieshixiang committed
1 2 3
<?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.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper">
xieshixiang committed
4 5 6 7 8 9 10

    <insert id="bindInfoInsert" parameterType="com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo">
        insert ignore into edl_public.bind_info(unq_id,user_id,phone,plate_color,plate_num,plate_type,gmt_bind_time)
        values (#{unqId},#{userId},#{phone},#{plateColor},#{plateNum},#{plateType},#{gmtBindTime})
    </insert>


lixian7 committed
11
    <select id="selectByQuery" parameterType="java.lang.String"
xieshixiang committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
            resultType="com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo">
        select b.unq_id, b.user_id, b.phone,
        case plate_color
        when 'A' then '白'
        when 'B' then '灰'
        when 'C' then '黄'
        when 'D' then '粉'
        when 'E' then '红'
        when 'F' then '紫'
        when 'G' then '绿'
        when 'H' then '蓝'
        when 'I' then '棕'
        when 'J' then '黑'
        end plateColor,
        case status
        when '0' then '未绑定'
        when '1' then '已绑定'
        end status,
lixian7 committed
30 31 32
        b.plate_num,b.plate_type,b.gmt_bind_time
        from edl_public.bind_info as b
        where b.status='1'
xieshixiang committed
33 34 35 36 37
            <if test="userId!=null and nuserId!=''">
                and b.user_id=#{userId}
            </if>
    </select>

xieshixiang committed
38 39 40 41 42
    <update id="unbind">
        update edl_public.bind_info as b set b.status="0",b.unbind_time=#{unbindTime} where b.unq_id=#{unqId}

    </update>

xieshixiang committed
43

xieshixiang committed
44 45
    <delete id="clearPast" parameterType="java.util.Date">
        delete from edl_public.bind_info as b where b.unbind_time <![CDATA[<=]]> #{dateTime} and b.status='0'
xieshixiang committed
46 47
    </delete>

xieshixiang committed
48
</mapper>