<?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.yida.data.school.transaction.mapper.EduProductModelMapper">

  <select id="selectEduProductModelPage"
    resultType="com.yida.data.common.core.entity.apply.EduProductModel">
    SELECT DISTINCT
    *
    FROM
    edu_product_model
    WHERE
    del_flag = 0
    AND (create_id = #{currentUser.userId}
    <if test='childIdList != null and childIdList.size > 0'>
      or create_dept_id IN
      <foreach collection="childIdList" open="(" close=")" separator="," item="deptId">
        #{deptId}
      </foreach>
    </if>
    )
    <if test="modelName != null and modelName != ''">
      and model_name LIKE CONCAT('%', #{modelName}, '%')
    </if>
    ORDER BY
    create_date DESC
  </select>
</mapper>
