|
|
@@ -1,212 +1,233 @@
|
|
|
<?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.izouma.awesomeadmin.dao.ProductImageMapper" >
|
|
|
- <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ProductImage" >
|
|
|
- <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
- <result column="del_flag" property="delFlag" jdbcType="CHAR" />
|
|
|
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
|
|
|
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="create_user" property="createUser" jdbcType="VARCHAR" />
|
|
|
- <result column="product_id" property="productId" jdbcType="VARCHAR" />
|
|
|
- <result column="image" property="image" jdbcType="VARCHAR" />
|
|
|
- <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
- <result column="rank" property="rank" jdbcType="INTEGER" />
|
|
|
- <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List" >
|
|
|
- <trim suffixOverrides="," >
|
|
|
- id,
|
|
|
-
|
|
|
- del_flag,
|
|
|
-
|
|
|
- update_time,
|
|
|
-
|
|
|
- update_user,
|
|
|
-
|
|
|
- create_time,
|
|
|
-
|
|
|
- create_user,
|
|
|
-
|
|
|
- product_id,
|
|
|
-
|
|
|
- image,
|
|
|
-
|
|
|
- remark,
|
|
|
-
|
|
|
- rank,
|
|
|
-
|
|
|
- name,
|
|
|
-
|
|
|
- </trim>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.izouma.awesomeadmin.dao.ProductImageMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
+ <!--generatedStart-->
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER"/>
|
|
|
+ <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
|
|
|
+ <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR"/>
|
|
|
+ <result column="product_id" property="productId" jdbcType="INTEGER"/>
|
|
|
+ <result column="type_flag" property="typeFlag" jdbcType="INTEGER"/>
|
|
|
+ <result column="image" property="image" jdbcType="VARCHAR"/>
|
|
|
+ <result column="remark" property="remark" jdbcType="VARCHAR"/>
|
|
|
+ <result column="rank" property="rank" jdbcType="INTEGER"/>
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--generatedStart-->
|
|
|
+ id, del_flag, update_time, update_user, create_time, create_user, name, product_id, type_flag, image, remark, rank <!--generatedEnd-->
|
|
|
</sql>
|
|
|
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from product_image
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM product_image
|
|
|
+ WHERE id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
- delete from product_image
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ DELETE
|
|
|
+ FROM product_image
|
|
|
+ WHERE id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
+
|
|
|
<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.ProductImage" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into product_image
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="id!= null" >
|
|
|
+ INSERT INTO product_image
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="id!= null">
|
|
|
id,
|
|
|
</if>
|
|
|
- <if test="delFlag!= null" >
|
|
|
+ <if test="delFlag!= null">
|
|
|
del_flag,
|
|
|
</if>
|
|
|
- <if test="updateTime!= null" >
|
|
|
+ <if test="updateTime!= null">
|
|
|
update_time,
|
|
|
</if>
|
|
|
- <if test="updateUser!= null" >
|
|
|
+ <if test="updateUser!= null">
|
|
|
update_user,
|
|
|
</if>
|
|
|
- <if test="createTime!= null" >
|
|
|
+ <if test="createTime!= null">
|
|
|
create_time,
|
|
|
</if>
|
|
|
- <if test="createUser!= null" >
|
|
|
+ <if test="createUser!= null">
|
|
|
create_user,
|
|
|
</if>
|
|
|
- <if test="productId!= null" >
|
|
|
+ <if test="name!= null">
|
|
|
+ name,
|
|
|
+ </if>
|
|
|
+ <if test="productId!= null">
|
|
|
product_id,
|
|
|
</if>
|
|
|
- <if test="image!= null" >
|
|
|
+ <if test="typeFlag!= null">
|
|
|
+ type_flag,
|
|
|
+ </if>
|
|
|
+ <if test="image!= null">
|
|
|
image,
|
|
|
</if>
|
|
|
- <if test="remark!= null" >
|
|
|
+ <if test="remark!= null">
|
|
|
remark,
|
|
|
</if>
|
|
|
- <if test="rank!= null" >
|
|
|
+ <if test="rank!= null">
|
|
|
rank,
|
|
|
</if>
|
|
|
- <if test="name!= null" >
|
|
|
- name,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="id != null" >
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="id != null">
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="delFlag != null" >
|
|
|
+ <if test="delFlag != null">
|
|
|
#{delFlag,jdbcType=CHAR},
|
|
|
</if>
|
|
|
- <if test="updateTime != null" >
|
|
|
+ <if test="updateTime != null">
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="updateUser != null" >
|
|
|
+ <if test="updateUser != null">
|
|
|
#{updateUser,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="createTime != null" >
|
|
|
+ <if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="createUser != null" >
|
|
|
+ <if test="createUser != null">
|
|
|
#{createUser,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="productId != null" >
|
|
|
- #{productId,jdbcType=VARCHAR},
|
|
|
+ <if test="name != null">
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="productId != null">
|
|
|
+ #{productId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="typeFlag != null">
|
|
|
+ #{typeFlag,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="image != null" >
|
|
|
+ <if test="image != null">
|
|
|
#{image,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="remark != null" >
|
|
|
+ <if test="remark != null">
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="rank != null" >
|
|
|
+ <if test="rank != null">
|
|
|
#{rank,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="name != null" >
|
|
|
- #{name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ProductImage" >
|
|
|
- update product_image
|
|
|
- <set >
|
|
|
- <if test="id != null" >
|
|
|
- id= #{id,jdbcType=INTEGER},
|
|
|
+
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
+ UPDATE product_image
|
|
|
+ <set>
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="id != null">
|
|
|
+ id= #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null">
|
|
|
+ del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
</if>
|
|
|
- <if test="delFlag != null" >
|
|
|
- del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time= #{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="updateTime != null" >
|
|
|
- update_time= #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="updateUser != null">
|
|
|
+ update_user= #{updateUser,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="updateUser != null" >
|
|
|
- update_user= #{updateUser,jdbcType=VARCHAR},
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time= #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time= #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user= #{createUser,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="createUser != null" >
|
|
|
- create_user= #{createUser,jdbcType=VARCHAR},
|
|
|
+ <if test="name != null">
|
|
|
+ name= #{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="productId != null" >
|
|
|
- product_id= #{productId,jdbcType=VARCHAR},
|
|
|
+ <if test="productId != null">
|
|
|
+ product_id= #{productId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="image != null" >
|
|
|
- image= #{image,jdbcType=VARCHAR},
|
|
|
+ <if test="typeFlag != null">
|
|
|
+ type_flag= #{typeFlag,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="remark != null" >
|
|
|
- remark= #{remark,jdbcType=VARCHAR},
|
|
|
+ <if test="image != null">
|
|
|
+ image= #{image,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="rank != null" >
|
|
|
- rank= #{rank,jdbcType=INTEGER},
|
|
|
+ <if test="remark != null">
|
|
|
+ remark= #{remark,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="name != null" >
|
|
|
- name= #{name,jdbcType=VARCHAR},
|
|
|
+ <if test="rank != null">
|
|
|
+ rank= #{rank,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </set>
|
|
|
+ WHERE
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
+ id IN (${idStr})
|
|
|
+ </if>
|
|
|
</update>
|
|
|
+
|
|
|
<select id="queryProductImageByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
- select <include refid="Base_Column_List"/> from product_image
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_image
|
|
|
<where>
|
|
|
- and del_flag = 'N'
|
|
|
- <if test="record.id != null and !"".equals(record.id)">
|
|
|
- and id = #{record.id}
|
|
|
+ AND del_flag = 'N'
|
|
|
+ <if test="record.idStr != null and !"".equals(record.idStr)">
|
|
|
+ AND id IN (${record.idStr})
|
|
|
</if>
|
|
|
- <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
- and del_flag = #{record.delFlag}
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
+ AND id = #{record.id}
|
|
|
</if>
|
|
|
- <if test="record.updateTime != null and !"".equals(record.updateTime)">
|
|
|
- and update_time = #{record.updateTime}
|
|
|
+ <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
+ AND del_flag = #{record.delFlag}
|
|
|
</if>
|
|
|
- <if test="record.updateUser != null and !"".equals(record.updateUser)">
|
|
|
- and update_user = #{record.updateUser}
|
|
|
+ <if test="record.updateTime != null and !"".equals(record.updateTime)">
|
|
|
+ AND update_time = #{record.updateTime}
|
|
|
</if>
|
|
|
- <if test="record.createTime != null and !"".equals(record.createTime)">
|
|
|
- and create_time = #{record.createTime}
|
|
|
+ <if test="record.updateUser != null and !"".equals(record.updateUser)">
|
|
|
+ AND update_user = #{record.updateUser}
|
|
|
</if>
|
|
|
- <if test="record.createUser != null and !"".equals(record.createUser)">
|
|
|
- and create_user = #{record.createUser}
|
|
|
+ <if test="record.createTime != null and !"".equals(record.createTime)">
|
|
|
+ AND create_time = #{record.createTime}
|
|
|
</if>
|
|
|
- <if test="record.productId != null and !"".equals(record.productId)">
|
|
|
- and product_id = #{record.productId}
|
|
|
+ <if test="record.createUser != null and !"".equals(record.createUser)">
|
|
|
+ AND create_user = #{record.createUser}
|
|
|
</if>
|
|
|
- <if test="record.image != null and !"".equals(record.image)">
|
|
|
- and image = #{record.image}
|
|
|
+ <if test="record.name != null and !"".equals(record.name)">
|
|
|
+ AND name = #{record.name}
|
|
|
</if>
|
|
|
- <if test="record.remark != null and !"".equals(record.remark)">
|
|
|
- and remark = #{record.remark}
|
|
|
+ <if test="record.productId != null and !"".equals(record.productId)">
|
|
|
+ AND product_id = #{record.productId}
|
|
|
</if>
|
|
|
- <if test="record.rank != null and !"".equals(record.rank)">
|
|
|
- and rank = #{record.rank}
|
|
|
+ <if test="record.typeFlag != null and !"".equals(record.typeFlag)">
|
|
|
+ AND type_flag = #{record.typeFlag}
|
|
|
</if>
|
|
|
- <if test="record.name != null and !"".equals(record.name)">
|
|
|
- and name = #{record.name}
|
|
|
+ <if test="record.image != null and !"".equals(record.image)">
|
|
|
+ AND image = #{record.image}
|
|
|
+ </if>
|
|
|
+ <if test="record.remark != null and !"".equals(record.remark)">
|
|
|
+ AND remark = #{record.remark}
|
|
|
+ </if>
|
|
|
+ <if test="record.rank != null and !"".equals(record.rank)">
|
|
|
+ AND rank = #{record.rank}
|
|
|
+ </if>
|
|
|
+ <!--generatedEnd-->
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ <!--generatedStart-->
|
|
|
+ OR name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR product_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR type_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR image LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </trim>
|
|
|
</if>
|
|
|
- <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
- <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
- OR product_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
- OR remark LIKE concat('%',#{record.searchKey},'%')
|
|
|
- OR rank LIKE concat('%',#{record.searchKey},'%')
|
|
|
- OR name LIKE concat('%',#{record.searchKey},'%')
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
|
|
|
<if test="record.advancedQuery != null and !"".equals(record.advancedQuery)">
|
|
|
<foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
|
|
|
@@ -216,11 +237,9 @@
|
|
|
<if test="detailIndex == 3">
|
|
|
concat('%',#{itemDetail},'%')
|
|
|
</if>
|
|
|
-
|
|
|
<if test="detailIndex < 3">
|
|
|
${itemDetail}
|
|
|
</if>
|
|
|
-
|
|
|
</foreach>
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
@@ -228,27 +247,17 @@
|
|
|
<if test="detailIndex == 3">
|
|
|
#{itemDetail}
|
|
|
</if>
|
|
|
-
|
|
|
<if test="detailIndex < 3">
|
|
|
${itemDetail}
|
|
|
</if>
|
|
|
-
|
|
|
</foreach>
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
-
|
|
|
-
|
|
|
</foreach>
|
|
|
-
|
|
|
-
|
|
|
</if>
|
|
|
-
|
|
|
</where>
|
|
|
- order by
|
|
|
-
|
|
|
+ ORDER BY
|
|
|
<if test="record.orderByStr != null and !"".equals(record.orderByStr)">
|
|
|
-
|
|
|
-
|
|
|
<trim suffixOverrides=",">
|
|
|
<foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
|
|
|
<foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
@@ -258,93 +267,95 @@
|
|
|
</trim>
|
|
|
,
|
|
|
</if>
|
|
|
- rank desc, id
|
|
|
+ id DESC
|
|
|
</select>
|
|
|
+
|
|
|
<select id="queryAllProductImage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
- select <include refid="Base_Column_List"/> from product_image
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_image
|
|
|
<where>
|
|
|
- and del_flag = 'N'
|
|
|
- <if test="id != null and !"".equals(id)">
|
|
|
- and id = #{id}
|
|
|
+ AND del_flag = 'N'
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
+ AND id IN (${idStr})
|
|
|
</if>
|
|
|
- <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
- and del_flag = #{delFlag}
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ AND id = #{id}
|
|
|
</if>
|
|
|
- <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
- and update_time = #{updateTime}
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ AND del_flag = #{delFlag}
|
|
|
</if>
|
|
|
- <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
- and update_user = #{updateUser}
|
|
|
+ <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
+ AND update_time = #{updateTime}
|
|
|
</if>
|
|
|
- <if test="createTime != null and !"".equals(createTime)">
|
|
|
- and create_time = #{createTime}
|
|
|
+ <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
+ AND update_user = #{updateUser}
|
|
|
</if>
|
|
|
- <if test="createUser != null and !"".equals(createUser)">
|
|
|
- and create_user = #{createUser}
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
+ AND create_time = #{createTime}
|
|
|
</if>
|
|
|
- <if test="productId != null and !"".equals(productId)">
|
|
|
- and product_id = #{productId}
|
|
|
+ <if test="createUser != null and !"".equals(createUser)">
|
|
|
+ AND create_user = #{createUser}
|
|
|
</if>
|
|
|
- <if test="image != null and !"".equals(image)">
|
|
|
- and image = #{image}
|
|
|
+ <if test="name != null and !"".equals(name)">
|
|
|
+ AND name = #{name}
|
|
|
</if>
|
|
|
- <if test="remark != null and !"".equals(remark)">
|
|
|
- and remark = #{remark}
|
|
|
+ <if test="productId != null and !"".equals(productId)">
|
|
|
+ AND product_id = #{productId}
|
|
|
</if>
|
|
|
- <if test="rank != null and !"".equals(rank)">
|
|
|
- and rank = #{rank}
|
|
|
+ <if test="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ AND type_flag = #{typeFlag}
|
|
|
</if>
|
|
|
- <if test="name != null and !"".equals(name)">
|
|
|
- and name = #{name}
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
+ AND image = #{image}
|
|
|
</if>
|
|
|
- <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
- <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
- OR product_id LIKE concat('%',#{searchKey},'%')
|
|
|
- OR remark LIKE concat('%',#{searchKey},'%')
|
|
|
- OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
- OR name LIKE concat('%',#{searchKey},'%')
|
|
|
- </trim>
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ AND remark = #{remark}
|
|
|
</if>
|
|
|
-<if test="advancedQuery != null and !"".equals(advancedQuery)">
|
|
|
- <foreach item="item" index="index" collection="advancedQuery.split('_;')">
|
|
|
- <choose>
|
|
|
- <when test="item.indexOf('like') != -1">
|
|
|
- <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
- <if test="detailIndex == 3">
|
|
|
- concat('%',#{itemDetail},'%')
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="detailIndex < 3">
|
|
|
- ${itemDetail}
|
|
|
- </if>
|
|
|
-
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
- <if test="detailIndex == 3">
|
|
|
- #{itemDetail}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="detailIndex < 3">
|
|
|
- ${itemDetail}
|
|
|
- </if>
|
|
|
-
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ AND rank = #{rank}
|
|
|
+ </if>
|
|
|
+ <!--generatedEnd-->
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR">
|
|
|
+ <!--generatedStart-->
|
|
|
+ OR name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR product_id LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR type_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR image LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR rank LIKE concat('%',#{searchKey},'%')
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ <if test="advancedQuery != null and !"".equals(advancedQuery)">
|
|
|
+ <foreach item="item" index="index" collection="advancedQuery.split('_;')">
|
|
|
+ <choose>
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
+ </if>
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
</foreach>
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
-
|
|
|
-
|
|
|
- </foreach>
|
|
|
-
|
|
|
-
|
|
|
-</if>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
- order by
|
|
|
-
|
|
|
+ ORDER BY
|
|
|
<if test="orderByStr != null and !"".equals(orderByStr)">
|
|
|
-
|
|
|
-
|
|
|
<trim suffixOverrides=",">
|
|
|
<foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
|
|
|
<foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
@@ -354,62 +365,76 @@
|
|
|
</trim>
|
|
|
,
|
|
|
</if>
|
|
|
-
|
|
|
- rank desc,id
|
|
|
+ id DESC
|
|
|
</select>
|
|
|
+
|
|
|
<select id="queryProductImage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
- select <include refid="Base_Column_List"/> from product_image
|
|
|
+ SELECT <include refid="Base_Column_List"/> FROM product_image
|
|
|
<where>
|
|
|
- and del_flag = 'N'
|
|
|
- <if test="id != null and !"".equals(id)">
|
|
|
- and id = #{id}
|
|
|
+ AND del_flag = 'N'
|
|
|
+ <!--generatedStart-->
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ AND id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ AND del_flag = #{delFlag}
|
|
|
</if>
|
|
|
- <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
- and del_flag = #{delFlag}
|
|
|
+ <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
+ AND update_time = #{updateTime}
|
|
|
</if>
|
|
|
- <if test="updateTime != null and !"".equals(updateTime)">
|
|
|
- and update_time = #{updateTime}
|
|
|
+ <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
+ AND update_user = #{updateUser}
|
|
|
</if>
|
|
|
- <if test="updateUser != null and !"".equals(updateUser)">
|
|
|
- and update_user = #{updateUser}
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
+ AND create_time = #{createTime}
|
|
|
</if>
|
|
|
- <if test="createTime != null and !"".equals(createTime)">
|
|
|
- and create_time = #{createTime}
|
|
|
+ <if test="createUser != null and !"".equals(createUser)">
|
|
|
+ AND create_user = #{createUser}
|
|
|
</if>
|
|
|
- <if test="createUser != null and !"".equals(createUser)">
|
|
|
- and create_user = #{createUser}
|
|
|
+ <if test="name != null and !"".equals(name)">
|
|
|
+ AND name = #{name}
|
|
|
</if>
|
|
|
- <if test="productId != null and !"".equals(productId)">
|
|
|
- and product_id = #{productId}
|
|
|
+ <if test="productId != null and !"".equals(productId)">
|
|
|
+ AND product_id = #{productId}
|
|
|
</if>
|
|
|
- <if test="image != null and !"".equals(image)">
|
|
|
- and image = #{image}
|
|
|
+ <if test="typeFlag != null and !"".equals(typeFlag)">
|
|
|
+ AND type_flag = #{typeFlag}
|
|
|
</if>
|
|
|
- <if test="remark != null and !"".equals(remark)">
|
|
|
- and remark = #{remark}
|
|
|
+ <if test="image != null and !"".equals(image)">
|
|
|
+ AND image = #{image}
|
|
|
</if>
|
|
|
- <if test="rank != null and !"".equals(rank)">
|
|
|
- and rank = #{rank}
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ AND remark = #{remark}
|
|
|
</if>
|
|
|
- <if test="name != null and !"".equals(name)">
|
|
|
- and name = #{name}
|
|
|
+ <if test="rank != null and !"".equals(rank)">
|
|
|
+ AND rank = #{rank}
|
|
|
</if>
|
|
|
-
|
|
|
+ <!--generatedEnd-->
|
|
|
</where>
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
+
|
|
|
<update id="delete">
|
|
|
UPDATE product_image SET del_flag = 'Y'
|
|
|
- <where>
|
|
|
- AND id = #{id}
|
|
|
- </where>
|
|
|
+ WHERE
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ id = #{id,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="idStr != null and !"".equals(idStr)">
|
|
|
+ id IN (${idStr})
|
|
|
+ </if>
|
|
|
</update>
|
|
|
+
|
|
|
<select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.ProductImage">
|
|
|
- select <include refid="Base_Column_List"/> from product_image
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM product_image
|
|
|
<where>
|
|
|
- and del_flag = 'N'
|
|
|
- </where>
|
|
|
- order by id desc
|
|
|
+ AND del_flag = 'N'
|
|
|
+ <!--generatedStart-->
|
|
|
+ <!--generatedEnd-->
|
|
|
+ </where>
|
|
|
+ ORDER BY id DESC
|
|
|
</select>
|
|
|
</mapper>
|
|
|
|