<?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.yx.face.dao.SystemConfigDao">


    <select id="selectList" resultType="com.yx.face.model.vo.SystemConfigVO">
        SELECT id, password , remark, status, account , account_id as adminId , create_time as createTime,
        type FROM system_config
        <where>
            <if test="accountId != 0">
                AND account_id = #{accountId}
            </if>
            <if test="status != 99">
                AND status = #{status}
            </if>
            <if test="adminId != null">
                AND admin_id =#{adminId}
            </if>
            AND type = #{type}
            AND account_id != '1'
        </where>
        ORDER BY account_id
    </select>
    <select id="sysConfiguration" resultType="com.yx.face.model.vo.SystemConfigVO">
        SELECT id,
               password,
               remark,
               status,
               account,
               account_id  as adminId,
               create_time as createTime,
               type
        FROM system_config
        where account_id = #{adminId}
    </select>
    <select id="selectByPrimaryOen" resultType="java.lang.Integer">
        SELECT count(id) FROM  system_config WHERE account_id = #{adminId}
    </select>

</mapper>

