|
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<resultMap type="RecBrand" id="RecBrandResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="brand" column="brand" />
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
<result property="createDate" column="create_date" />
|
|
|
<result property="updateBy" column="update_by" />
|
|
@@ -14,16 +15,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectRecBrandVo">
|
|
|
- select id, brand, create_by, create_date, update_by, update_date from rec_brand
|
|
|
+ select id, brand, parent_id, create_by, create_date, update_by, update_date from rec_brand
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectRecBrandList" parameterType="RecBrand" resultMap="RecBrandResult">
|
|
|
<include refid="selectRecBrandVo"/>
|
|
|
<where>
|
|
|
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
|
|
|
+ <if test="parentId != null"> and parent_id = #{parentId}</if>
|
|
|
<if test="createDate != null "> and create_date = #{createDate}</if>
|
|
|
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
|
|
</where>
|
|
|
+ order by parent_id, id
|
|
|
</select>
|
|
|
|
|
|
<select id="selectRecBrandById" parameterType="Long" resultMap="RecBrandResult">
|
|
@@ -35,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
insert into rec_brand
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="brand != null">brand,</if>
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="createDate != null">create_date,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
@@ -42,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="brand != null">#{brand},</if>
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createDate != null">#{createDate},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
@@ -53,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
update rec_brand
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="brand != null">brand = #{brand},</if>
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
<if test="createDate != null">create_date = #{createDate},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|