BindInfoMapper.xml 1.83 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.editor_time from edl_public.bind_info as b where b.status='1'
xieshixiang committed
24 25 26 27 28 29 30 31 32 33 34 35
            <if test="userId!=null and nuserId!=''">
                and b.user_id=#{userId}
            </if>
            <if test="phone!=null and phone!=''">
                and b.phone=#{phone}
            </if>
            <if test="plateColor!=null and plateColor!=''">
                and b.plate_color=#{plateColor}
            </if>
            <if test="plateNum!=null and plateNum!=''">
                and b.plate_num=#{plateNum}
            </if>
36 37 38
            <if test="plateType!=null and plateType!=''">
                and b.plate_type=#{plateType}
            </if>
xieshixiang committed
39 40 41 42 43
            <if test="editorTime!=null ">
                and b.editor_time=#{editorTime}
            </if>
    </select>

xieshixiang committed
44 45 46 47 48

    <delete id="clearPast">
        delete from edl_public.bind_info as b where b.editor_time <![CDATA[ <= ]]> #{dateTime} and b.status='0'
    </delete>

xieshixiang committed
49
</mapper>