BindInfoMapper.xml 1.37 KB
Newer Older
xieshixiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?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">
    <select id="selectByQuery" parameterType="com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery"
            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,
xieshixiang committed
23
        b.plate_num,b.plate_type,b.gmt_bind_time from edl_public.bind_info as b where b.status='1'
xieshixiang committed
24 25 26 27 28 29 30 31
            <if test="userId!=null and nuserId!=''">
                and b.user_id=#{userId}
            </if>
            <if test="phone!=null and phone!=''">
                and b.phone=#{phone}
            </if>
    </select>

xieshixiang committed
32 33

    <delete id="clearPast">
xieshixiang committed
34
        delete from edl_public.bind_info as b where b.unbind_time <![CDATA[ <= ]]> #{dateTime} and b.status='0'
xieshixiang committed
35 36
    </delete>

xieshixiang committed
37
</mapper>