|
- <?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.PersonMouldMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.PersonMould">
- <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="video_type" jdbcType="INTEGER" property="videoType"/>
- <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
- <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
- <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/>
- <result column="title" jdbcType="VARCHAR" property="title"/>
- <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/>
- <result column="sex" jdbcType="INTEGER" property="sex"/>
- <result column="age" jdbcType="INTEGER" property="age"/>
- <result column="colour" jdbcType="INTEGER" property="colour"/>
- <result column="scene_sign" jdbcType="VARCHAR" property="sceneSign"/>
- <result column="sale_price" jdbcType="INTEGER" property="salePrice"/>
- <result column="price" jdbcType="INTEGER" property="price"/>
- <result column="send_type" jdbcType="INTEGER" property="sendType"/>
- <result column="detail" jdbcType="VARCHAR" property="detail"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="mould_sm_id" jdbcType="VARCHAR" property="mouldSmId"/>
- <result column="material" jdbcType="VARCHAR" property="material"/>
- <result column="status" jdbcType="INTEGER" property="status"/>
- <result column="puton_date" jdbcType="TIMESTAMP" property="putonDate"/>
- <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`, `video_type`, `cover_img`, `cover_picture`, `detail_picture`,
- `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`,
- `send_type`, `detail`, `remark`, `mould_sm_id`,`material`, `status`, `puton_date`, `create_date`, `update_date`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where `is_del` = 0
-
- <if test=" null != id ">
- and `id` = #{id}
- </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 != videoType ">
- and `video_type` = #{videoType}
- </if>
-
- <if test=" null != title and ''!=title">
- and `title` like concat('%', #{title},'%')
- </if>
-
- <if test=" null != subTitle ">
- and `sub_title` like concat('%', #{subTitle},'%')
- </if>
-
- <if test=" null != sex ">
- and `sex` = #{sex}
- </if>
-
- <if test=" null != age ">
- and `age` = #{age}
- </if>
-
- <if test=" null != colour ">
- and `colour` = #{colour}
- </if>
-
- <if test=" null != sceneSign and '' != sceneSign">
- and JSON_CONTAINS(scene_sign,json_array(#{sceneSign}))
- </if>
-
- <if test=" null != salePrice ">
- and `sale_price` = #{salePrice}
- </if>
-
- <if test=" null != sendType ">
- and `send_type` = #{sendType}
- </if>
-
- <if test=" null != price ">
- and `price` = #{price}
- </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.PersonMould" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from person_mould
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <delete id="deleteById" parameterType="java.util.HashMap">
- update person_mould set is_del = 1,update_date = now() where id = #{id}
- </delete>
-
- <select id="findCList" parameterType="com.iformall.domain.po.sm.PersonMould" resultMap="BaseResultMap">
- select
- `id`, `video_type`, `cover_img`, `cover_picture`,
- `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`,
- `send_type`, `mould_sm_id`,`material`, `status`, `create_date`, `update_date`
- from person_mould
- <include refid="dynamicWhereConditions"/>
- </select>
-
- </mapper>
|