<?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.xxfc.platform.app.mapper.AppVersionMarkMapper">

    <select id="queryIsMark" parameterType="java.lang.String" resultType="java.lang.Integer">
        SELECT
        count(*)
        FROM
        `app_version_mark`
        where
        is_del=0
        <if test="mark!=null and mark!=''">
            and binary mark like concat('%',#{mark},'%')
        </if>
    </select>


    <select id="queryIsMarkNew" parameterType="java.lang.String" resultType="java.lang.Integer">
        SELECT
        count(*)
        FROM
        `app_version_mark`
        where
        is_del=0
        <if test="mark!=null and mark!=''">
            and binary mark=#{mark}
        </if>
    </select>

    <select id="findVersionAppMark" resultType="com.xxfc.platform.app.entity.AppVersionMark">
        select * from
        `app_version_mark` a
        where
        is_del = 0
        <if test="mark!=null and mark!=''">
            and binary mark like concat('%',#{mark},'%')
        </if>
    </select>


    <select id="findIosOrAndroidVersionAppMark" resultType="java.lang.Integer">
        select count(*) from
        `app_version_mark` a
        where
        is_del = 0
        <if test="id!=null and id!=''">
            and id= #{id}
        </if>
        and ( mark_name like concat('%','ios','%')
        or mark_name like concat('%','安卓','%'))
    </select>


    <select id="findListVersionAppMark" resultType="com.xxfc.platform.app.entity.AppVersionMark">
        select  `mark_name`,`mark`
	    from
        `app_version_mark` a
        where
        is_del = 0
      </select>

    <select id="queryListForUserMember" resultType="com.xxfc.platform.app.entity.AppVersionMark">
        select  `mark_name` as registerSource
	    from
        `app_version_mark` a
        where
        is_del = 0
      </select>
</mapper>