类型名称
This commit is contained in:
@@ -31,6 +31,8 @@ public class Product extends BaseEntity
|
||||
@Excel(name = "商品名称")
|
||||
private String name;
|
||||
|
||||
private String typeName;
|
||||
|
||||
/** 商品描述 */
|
||||
@Excel(name = "商品描述")
|
||||
private String description;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.ProductMapper">
|
||||
|
||||
|
||||
<resultMap type="Product" id="ProductResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productId" column="product_id" />
|
||||
@@ -20,15 +20,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="sales" column="sales" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="typeName" column="type_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProductVo">
|
||||
select id, product_id, name, description, category_id, product_type, status, original_price, current_price, monthly_duration, quarterly_duration, stock, sales, created_at, updated_at from product
|
||||
select id, product_id, name, description, category_id, product_type, status, original_price, current_price, monthly_duration, quarterly_duration, stock, sales, created_at, updated_at,type_name from product
|
||||
</sql>
|
||||
|
||||
<select id="selectProductList" parameterType="Product" resultMap="ProductResult">
|
||||
<include refid="selectProductVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
@@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectProductById" parameterType="String" resultMap="ProductResult">
|
||||
<include refid="selectProductVo"/>
|
||||
where id = #{id}
|
||||
@@ -68,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="sales != null">sales,</if>
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
<if test="typeName != null">type_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">#{productId},</if>
|
||||
@@ -84,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="sales != null">#{sales},</if>
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
<if test="typeName != null">#{typeName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -104,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="sales != null">sales = #{sales},</if>
|
||||
<if test="createdAt != null">created_at = #{createdAt},</if>
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
<if test="typeName != null">type_name = #{typeName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@@ -113,9 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProductByIds" parameterType="String">
|
||||
delete from product where id in
|
||||
delete from product where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user