<?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.panzhihua.service_jinhui_community.dao.JinhuiComConvenientServiceCategoriesDao">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_jinhui_community.entity.JinhuiComConvenientServiceCategories">
|
<id column="id" property="id" />
|
<id column="name" property="name" />
|
<id column="icon" property="icon" />
|
<id column="remark" property="remark" />
|
<id column="weight" property="weight" />
|
<id column="is_del" property="isDel" />
|
<id column="created_at" property="createdAt" />
|
<id column="created_by" property="createdBy" />
|
<id column="updated_at" property="updatedAt" />
|
<id column="parent_id" property="parentId" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id,
|
name,
|
icon,
|
remark,
|
weight,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
parent_id
|
|
</sql>
|
|
<!-- 分页查询 -->
|
<select id="getList" resultMap="BaseResultMap">
|
select
|
id,
|
name,
|
icon,
|
remark,
|
weight,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
parent_id
|
from jinhui_com_convenient_service_categories
|
where is_del='0'
|
order by weight desc,created_at desc
|
</select>
|
|
|
<select id="getDetails" resultMap="BaseResultMap">
|
select
|
id,
|
name,
|
icon,
|
remark,
|
weight,
|
is_del,
|
created_at,
|
created_by,
|
updated_at,
|
parent_id
|
from jinhui_com_convenient_service_categories
|
where
|
id=#{id}
|
</select>
|
|
|
|
<insert id="addData">
|
insert into jinhui_com_convenient_service_categories
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
id,
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
`name`,
|
</if>
|
<if test="item.icon != null and item.icon != '' ">
|
icon,
|
</if>
|
<if test="item.remark != null and item.remark != '' ">
|
remark,
|
</if>
|
<if test="item.weight != null and item.weight != '' ">
|
weight,
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
is_del,
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
created_by,
|
</if>
|
<if test="item.parentId != null and item.parentId != '' ">
|
parent_id,
|
</if>
|
created_at
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="item.id != null and item.id != '' ">
|
#{item.id},
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
#{item.name},
|
</if>
|
<if test="item.icon != null and item.icon != '' ">
|
#{item.icon},
|
</if>
|
<if test="item.remark != null and item.remark != '' ">
|
#{item.remark},
|
</if>
|
<if test="item.weight != null and item.weight != '' ">
|
#{item.weight},
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
#{item.isDel},
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
#{item.createdBy},
|
</if>
|
<if test="item.parentId != null and item.parentId != '' ">
|
#{item.parentId},
|
</if>
|
sysdate()
|
</trim>
|
</insert>
|
|
<update id="editData">
|
update jinhui_com_convenient_service_categories
|
<set>
|
<if test="item.id != null and item.id != '' ">
|
id=#{item.id},
|
</if>
|
<if test="item.name != null and item.name != '' ">
|
`name`=#{item.name},
|
</if>
|
<if test="item.icon != null and item.icon != '' ">
|
icon=#{item.icon},
|
</if>
|
<if test="item.remark != null and item.remark != '' ">
|
remark=#{item.remark},
|
</if>
|
<if test="item.weight != null and item.weight != '' ">
|
weight=#{item.weight},
|
</if>
|
<if test="item.isDel != null and item.isDel != '' ">
|
is_del=#{item.isDel},
|
</if>
|
<if test="item.createdBy != null and item.createdBy != '' ">
|
created_by=#{item.createdBy},
|
</if>
|
<if test="item.parentId != null and item.parentId != '' ">
|
parent_id=#{item.parentId},
|
</if>
|
updated_at=sysdate()
|
</set>
|
where id = #{item.id}
|
</update>
|
|
<update id="expurgateData" parameterType="String">
|
update jinhui_com_convenient_service_categories
|
set is_del='1'
|
where id=#{id}
|
</update>
|
|
|
</mapper>
|