元气智驾官网后台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

87 linhas
3.2 KiB

  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.iformall.mapper.YqzjNewsMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.yqzj.YqzjNews">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="type" jdbcType="INTEGER" property="type"/>
  9. <result column="sub_type" jdbcType="INTEGER" property="subType"/>
  10. <result column="tag" jdbcType="VARCHAR" property="tag"/>
  11. <result column="title" jdbcType="VARCHAR" property="title"/>
  12. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  13. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  14. <result column="image" jdbcType="VARCHAR" property="image"/>
  15. <result column="video" jdbcType="VARCHAR" property="video"/>
  16. <result column="send_date" jdbcType="TIMESTAMP" property="sendDate"/>
  17. <result column="status" jdbcType="INTEGER" property="status"/>
  18. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  19. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  20. </resultMap>
  21. <sql id="allColumns">
  22. `id`,`tenant_id`,`parent_tenant_id`,`type`,`sub_type`,`tag`,`title`,`sub_title`,`detail`,`image`,`video`,`send_date`,`status`,`create_date`,`update_date`
  23. </sql>
  24. <sql id="dynamicWhereConditions">
  25. where 1 = 1
  26. <if test=" null != id ">
  27. and `id` = #{id}
  28. </if>
  29. <if test=" null != tenantId and '' != tenantId">
  30. and `tenant_id` = #{tenantId}
  31. </if>
  32. <if test=" null != parentTenantId and '' != parentTenantId">
  33. and `parent_tenant_id` = #{parentTenantId}
  34. </if>
  35. <if test=" null != type ">
  36. and `type` = #{type}
  37. </if>
  38. <if test=" null != subType ">
  39. and `sub_type` = #{subType}
  40. </if>
  41. <if test=" null != tag ">
  42. and `tag` = #{tag}
  43. </if>
  44. <if test=" null != title ">
  45. and `title` like concat('%', #{title},'%')
  46. </if>
  47. <if test=" null != sendDateBegin ">
  48. and `send_date` &gt;= #{sendDateBegin}
  49. </if>
  50. <if test=" null != sendDateEnd ">
  51. and `send_date` &lt;= #{sendDateEnd}
  52. </if>
  53. <if test=" videHas == 1">
  54. and `video` is not null and `video` != ''
  55. </if>
  56. <if test=" null != ids ">
  57. and id in
  58. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  59. #{idItem}
  60. </foreach>
  61. </if>
  62. <if test=" null != sortColumns">order by ${sortColumns}</if>
  63. </sql>
  64. <select id="findList" parameterType="com.iformall.domain.po.yqzj.YqzjNews" resultMap="BaseResultMap">
  65. select
  66. <include refid="allColumns"/>
  67. from yqzj_news
  68. <include refid="dynamicWhereConditions"/>
  69. </select>
  70. </mapper>