后台服务
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.

117 lines
4.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.UserDigitalAvatarOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.UserDigitalAvatarOrder">
  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="plat" jdbcType="INTEGER" property="plat"/>
  9. <result column="order_id" jdbcType="BIGINT" property="orderId"/>
  10. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  11. <result column="user_images" jdbcType="VARCHAR" property="userImages"/>
  12. <result column="digital_avatar_id" jdbcType="BIGINT" property="digitalAvatarId"/>
  13. <result column="digital_avatar_type" jdbcType="INTEGER" property="digitalAvatarType"/>
  14. <result column="digital_avatar_sm" jdbcType="VARCHAR" property="digitalAvatarSm"/>
  15. <result column="price" jdbcType="INTEGER" property="price"/>
  16. <result column="title" jdbcType="VARCHAR" property="title"/>
  17. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  18. <result column="status" jdbcType="INTEGER" property="status"/>
  19. <result column="msg" jdbcType="VARCHAR" property="msg"/>
  20. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  21. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  22. </resultMap>
  23. <sql id="allColumns">
  24. `id`, `tenant_id`, `parent_tenant_id`, `plat`, `order_id`, `user_id`,
  25. `user_images`, `digital_avatar_id`, `digital_avatar_type`, `digital_avatar_sm`, `price`,
  26. `title`, `remark`, `status`, `msg`, `create_date`, `update_date`
  27. </sql>
  28. <sql id="dynamicWhereConditions">
  29. where `is_del` = 0
  30. <if test=" null != id ">
  31. and `id` = #{id}
  32. </if>
  33. <if test=" null != plat ">
  34. and `plat` = #{plat}
  35. </if>
  36. <if test=" null != tenantId and '' != tenantId">
  37. and `tenant_id` = #{tenantId}
  38. </if>
  39. <if test=" null != parentTenantId and '' != parentTenantId">
  40. and `parent_tenant_id` = #{parentTenantId}
  41. </if>
  42. <if test=" null != orderId ">
  43. and `order_id` = #{orderId}
  44. </if>
  45. <if test=" null != userId ">
  46. and `user_id` = #{userId}
  47. </if>
  48. <if test=" null != digitalAvatarId ">
  49. and `digital_avatar_id` = #{digitalAvatarId}
  50. </if>
  51. <if test=" null != digitalAvatarType ">
  52. and `digital_avatar_type` = #{digitalAvatarType}
  53. </if>
  54. <if test=" null != title and ''!=title">
  55. and `title` like concat('%', #{title},'%')
  56. </if>
  57. <if test=" null != status ">
  58. and `status` = #{status}
  59. </if>
  60. <if test=" null != startDate ">
  61. and create_date &gt;= #{startDate}
  62. </if>
  63. <if test=" null != endDate">
  64. and create_date &lt; #{endDate}
  65. </if>
  66. <if test=" null != ids ">
  67. and id in
  68. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  69. #{idItem}
  70. </foreach>
  71. </if>
  72. <if test=" null != sortColumns">order by ${sortColumns}</if>
  73. </sql>
  74. <select id="findList" parameterType="com.iformall.domain.po.sm.UserDigitalAvatarOrder" resultMap="BaseResultMap">
  75. select
  76. <include refid="allColumns"/>
  77. from user_digital_avatar_order
  78. <include refid="dynamicWhereConditions"/>
  79. </select>
  80. <delete id="deleteById" parameterType="java.util.HashMap">
  81. update user_digital_avatar_order set is_del = 1,update_date = now() where id = #{id}
  82. </delete>
  83. <select id="findCList" parameterType="com.iformall.domain.po.sm.UserDigitalAvatarOrder" resultMap="BaseResultMap">
  84. select
  85. `id`, `order_id`,
  86. `digital_avatar_type`,
  87. `title`, `remark`, `status`, `msg`,`create_date`, `update_date`
  88. from user_digital_avatar_order
  89. <include refid="dynamicWhereConditions"/>
  90. </select>
  91. <select id="findCount" parameterType="java.util.HashMap" resultType="Integer">
  92. select count(1)
  93. from user_digital_avatar_order
  94. where `order_id` = #{orderId}
  95. </select>
  96. </mapper>