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