|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.UserDigitalAvatarOrderMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.UserDigitalAvatarOrder">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
- <result column="plat" jdbcType="INTEGER" property="plat"/>
- <result column="order_id" jdbcType="BIGINT" property="orderId"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="user_images" jdbcType="VARCHAR" property="userImages"/>
- <result column="digital_avatar_id" jdbcType="BIGINT" property="digitalAvatarId"/>
- <result column="digital_avatar_type" jdbcType="INTEGER" property="digitalAvatarType"/>
- <result column="digital_avatar_sm" jdbcType="VARCHAR" property="digitalAvatarSm"/>
- <result column="price" jdbcType="INTEGER" property="price"/>
-
- <result column="title" jdbcType="VARCHAR" property="title"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="msg" jdbcType="VARCHAR" property="msg"/>
-
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`, `tenant_id`, `parent_tenant_id`, `plat`, `order_id`, `user_id`,
- `user_images`, `digital_avatar_id`, `digital_avatar_type`, `digital_avatar_sm`, `price`,
- `title`, `remark`, `status`, `msg`, `create_date`, `update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `is_del` = 0
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != plat ">
- and `plat` = #{plat}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != orderId ">
- and `order_id` = #{orderId}
- </if>
-
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </if>
-
- <if test=" null != digitalAvatarId ">
- and `digital_avatar_id` = #{digitalAvatarId}
- </if>
-
- <if test=" null != digitalAvatarType ">
- and `digital_avatar_type` = #{digitalAvatarType}
- </if>
-
- <if test=" null != title and ''!=title">
- and `title` like concat('%', #{title},'%')
- </if>
-
- <if test=" null != status ">
- and `status` = #{status}
- </if>
-
- <if test=" null != startDate ">
- and create_date >= #{startDate}
- </if>
- <if test=" null != endDate">
- and create_date < #{endDate}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.sm.UserDigitalAvatarOrder" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from user_digital_avatar_order
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <delete id="deleteById" parameterType="java.util.HashMap">
- update user_digital_avatar_order set is_del = 1,update_date = now() where id = #{id}
- </delete>
-
- <select id="findCList" parameterType="com.iformall.domain.po.sm.UserDigitalAvatarOrder" resultMap="BaseResultMap">
- select
- `id`, `order_id`,
- `digital_avatar_type`,
- `title`, `remark`, `status`, `msg`,`create_date`, `update_date`
- from user_digital_avatar_order
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findCount" parameterType="java.util.HashMap" resultType="Integer">
- select count(1)
- from user_digital_avatar_order
- where `order_id` = #{orderId}
- </select>
- </mapper>
|