北京机场
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
6.1 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.VoiceMouldMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.VoiceMould">
  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="parent_id" jdbcType="INTEGER" property="parentId"/>
  9. <result column="count_sub" jdbcType="BIGINT" property="countSub"/>
  10. <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
  11. <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
  12. <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
  13. <result column="title" jdbcType="VARCHAR" property="title"/>
  14. <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
  15. <result column="sex" jdbcType="INTEGER" property="sex"/>
  16. <result column="age_type" jdbcType="INTEGER" property="ageType"/>
  17. <result column="languages" jdbcType="BIGINT" property="languages"/>
  18. <result column="scene_sign" jdbcType="VARCHAR" property="sceneSign"/>
  19. <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
  20. <result column="price" jdbcType="INTEGER" property="price"/>
  21. <result column="send_type" jdbcType="INTEGER" property="sendType"/>
  22. <result column="detail" jdbcType="VARCHAR" property="detail"/>
  23. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  24. <result column="mould_sm_id" jdbcType="VARCHAR" property="mouldSmId"/>
  25. <result column="voice_type" jdbcType="INTEGER" property="voiceType"/>
  26. <result column="person_type" jdbcType="INTEGER" property="personType"/>
  27. <result column="speak_type" jdbcType="INTEGER" property="speakType"/>
  28. <result column="example_video_id" jdbcType="VARCHAR" property="exampleVideoId"/>
  29. <result column="status" jdbcType="INTEGER" property="status"/>
  30. <result column="puton_date" jdbcType="TIMESTAMP" property="putonDate"/>
  31. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  32. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  33. </resultMap>
  34. <sql id="allColumns">
  35. `id`, `tenant_id`, `parent_tenant_id`, `parent_id`, `count_sub`, `cover_img`, `cover_picture`, `detail_picture`,
  36. `title`, `sub_title`, `sex`, `age_type`, `languages`, `scene_sign`, `sale_price`, `price`,
  37. `send_type`, `detail`, `remark`, `mould_sm_id`,`voice_type`,`person_type`,`speak_type`, `example_video_id`, `status`, `puton_date`, `create_date`, `update_date`
  38. </sql>
  39. <sql id="dynamicWhereConditions">
  40. where `is_del` = 0
  41. <if test=" null != id ">
  42. and `id` = #{id}
  43. </if>
  44. <if test=" null != tenantId and '' != tenantId">
  45. and `tenant_id` = #{tenantId}
  46. </if>
  47. <if test=" null != parentTenantId and '' != parentTenantId">
  48. and `parent_tenant_id` = #{parentTenantId}
  49. </if>
  50. <if test=" null != parentId ">
  51. and `parent_id` = #{parentId}
  52. </if>
  53. <if test=" null != countSub ">
  54. and `count_sub` = #{countSub}
  55. </if>
  56. <if test=" null != title and ''!=title">
  57. and `title` like concat('%', #{title},'%')
  58. </if>
  59. <if test=" null != subTitle ">
  60. and `sub_title` like concat('%', #{subTitle},'%')
  61. </if>
  62. <if test=" null != sex ">
  63. and `sex` = #{sex}
  64. </if>
  65. <if test=" null != ageType ">
  66. and `age_type` = #{ageType}
  67. </if>
  68. <if test=" null != languages ">
  69. and `languages` = #{languages}
  70. </if>
  71. <if test=" null != sceneSign and '' != sceneSign">
  72. and JSON_CONTAINS(scene_sign,json_array(#{sceneSign}))
  73. </if>
  74. <if test=" null != salePrice ">
  75. and `sale_price` = #{salePrice}
  76. </if>
  77. <if test=" null != sendType ">
  78. and `send_type` = #{sendType}
  79. </if>
  80. <if test=" null != price ">
  81. and `price` = #{price}
  82. </if>
  83. <if test=" null != status">
  84. and `status` = #{status}
  85. </if>
  86. <if test=" null != voiceType ">
  87. and `voice_type` = #{voiceType}
  88. </if>
  89. <if test=" null != personType ">
  90. and `person_type` = #{personType}
  91. </if>
  92. <if test=" null != speakType ">
  93. and `speak_type` = #{speakType}
  94. </if>
  95. <if test=" null != startDate ">
  96. and create_date &gt;= #{startDate}
  97. </if>
  98. <if test=" null != endDate">
  99. and create_date &lt; #{endDate}
  100. </if>
  101. <if test=" null != ids ">
  102. and id in
  103. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  104. #{idItem}
  105. </foreach>
  106. </if>
  107. <if test=" null != sortColumns">order by ${sortColumns}</if>
  108. </sql>
  109. <select id="findList" parameterType="com.iformall.domain.po.sm.VoiceMould" resultMap="BaseResultMap">
  110. select
  111. <include refid="allColumns"/>
  112. from voice_mould
  113. <include refid="dynamicWhereConditions"/>
  114. </select>
  115. <delete id="deleteById" parameterType="java.util.HashMap">
  116. update voice_mould set is_del = 1,update_date = now() where id = #{id}
  117. </delete>
  118. <select id="findCList" parameterType="com.iformall.domain.po.sm.VoiceMould" resultMap="BaseResultMap">
  119. select
  120. `id`, `parent_tenant_id`, `parent_id`, `cover_img`, `cover_picture`,
  121. `title`, `sub_title`, `sex`, `age_type`, `languages`, `scene_sign`, `sale_price`, `price`,
  122. `send_type`, `mould_sm_id`,`voice_type`,`person_type`,`speak_type`, `status`,`example_video_id`, `create_date`, `update_date`
  123. from voice_mould
  124. <include refid="dynamicWhereConditions"/>
  125. </select>
  126. </mapper>