|
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<resultMap type="Product" id="ProductResult">
|
|
<resultMap type="Product" id="ProductResult">
|
|
<result property="id" column="id" />
|
|
<result property="id" column="id" />
|
|
<result property="parentId" column="parent_id" />
|
|
<result property="parentId" column="parent_id" />
|
|
|
|
+ <result property="parentName" column="parent_name" />
|
|
<result property="name" column="name" />
|
|
<result property="name" column="name" />
|
|
<result property="snsId" column="sns_id" />
|
|
<result property="snsId" column="sns_id" />
|
|
<result property="isDelete" column="is_delete" />
|
|
<result property="isDelete" column="is_delete" />
|
|
@@ -17,20 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectProductVo">
|
|
<sql id="selectProductVo">
|
|
- select id, parent_id, name, sns_id, is_delete, create_by, create_time, update_by, update_time from phm_product
|
|
|
|
|
|
+ select id, parent_id, parent_name, name, sns_id, is_delete, create_by, create_time, update_by, update_time from phm_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="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
|
|
|
+ <if test="parentName != null and parentName != ''"> and parent_name like concat('%', #{parentName}, '%')</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="snsId != null and snsId != ''"> and sns_id = #{snsId}</if>
|
|
<if test="snsId != null and snsId != ''"> and sns_id = #{snsId}</if>
|
|
- <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
|
- <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
|
|
|
- <if test="createTime != null "> and create_time = #{createTime}</if>
|
|
|
|
- <if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
|
|
|
|
- <if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -43,7 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
insert into phm_product
|
|
insert into phm_product
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="parentId != null">parent_id,</if>
|
|
<if test="parentId != null">parent_id,</if>
|
|
- <if test="name != null and name != ''">name,</if>
|
|
|
|
|
|
+ <if test="parentName != null">parent_name,</if>
|
|
|
|
+ <if test="name != null">name,</if>
|
|
<if test="snsId != null">sns_id,</if>
|
|
<if test="snsId != null">sns_id,</if>
|
|
<if test="isDelete != null">is_delete,</if>
|
|
<if test="isDelete != null">is_delete,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
@@ -53,7 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="parentId != null">#{parentId},</if>
|
|
<if test="parentId != null">#{parentId},</if>
|
|
- <if test="name != null and name != ''">#{name},</if>
|
|
|
|
|
|
+ <if test="parentName != null">#{parentName},</if>
|
|
|
|
+ <if test="name != null">#{name},</if>
|
|
<if test="snsId != null">#{snsId},</if>
|
|
<if test="snsId != null">#{snsId},</if>
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
@@ -67,7 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
update phm_product
|
|
update phm_product
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
- <if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
|
|
+ <if test="parentName != null">parent_name = #{parentName},</if>
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
<if test="snsId != null">sns_id = #{snsId},</if>
|
|
<if test="snsId != null">sns_id = #{snsId},</if>
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|