KwsEntSpecialDao.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sckw.system.dao.KwsEntSpecialDao">
  4. <select id="findList" resultType="com.sckw.system.model.KwsEntSpecial" parameterType="java.util.Map" >
  5. SELECT
  6. id, special_id specialId, ent_id entId, remark, status, create_by createBy,
  7. create_time createTime, update_by updateBy, update_time updateTime
  8. from kws_ent_special
  9. where del_flag = 0
  10. <if test="entId != null and entId != ''">
  11. and ent_id = #{entId, jdbcType=BIGINT}
  12. </if>
  13. <if test="specialId != null and specialId != ''">
  14. and special_id = #{specialId, jdbcType=BIGINT}
  15. </if>
  16. ORDER BY create_time desc
  17. </select>
  18. <select id="findListByEntType" parameterType="java.util.Map" >
  19. select
  20. DISTINCT ke.id entId
  21. from kws_enterprise ke
  22. left join kws_ent_type ket on ket.ent_id = ke.id and ket.del_flag = 0
  23. left join kws_ent_special kes on kes.ent_id = ke.id and kes.del_flag = 0
  24. where ke.del_flag = 0
  25. <if test="entId != null and entId != ''">
  26. and ke.id = #{entId, jdbcType=BIGINT}
  27. </if>
  28. <if test="specialId != null and specialId != ''">
  29. and kes.special_id = #{specialId, jdbcType=BIGINT}
  30. </if>
  31. <if test="mainPlatform != null and mainPlatform != ''">
  32. and kes.special_id is null
  33. </if>
  34. <if test="type != null and type != ''">
  35. and FIND_IN_SET(ket.type, #{type})
  36. </if>
  37. </select>
  38. </mapper>