后台服务
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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