79 lines
2.6 KiB
XML
79 lines
2.6 KiB
XML
|
<?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.haitongauto.mapper.base.ServiceConfigMapper">
|
||
|
<!--添加数据-->
|
||
|
<select id="insert" parameterType="com.haitongauto.models.pojo.ServiceConfig" resultType="String">
|
||
|
insert into applet_service_config
|
||
|
(
|
||
|
id,
|
||
|
config_name,
|
||
|
config_code,
|
||
|
config_content,
|
||
|
create_time,
|
||
|
update_time,
|
||
|
is_del
|
||
|
)
|
||
|
values
|
||
|
(
|
||
|
#{id},
|
||
|
#{config_name},
|
||
|
#{config_code},
|
||
|
#{config_content},
|
||
|
current_timestamp,
|
||
|
current_timestamp,
|
||
|
0
|
||
|
)
|
||
|
returning id
|
||
|
</select>
|
||
|
<!--软删除-->
|
||
|
<update id="logicDel" parameterType="String">
|
||
|
update applet_service_config set is_del=1 where id=#{id}
|
||
|
</update>
|
||
|
<!--硬删除-->
|
||
|
<delete id="delete" parameterType="String">
|
||
|
delete from applet_service_config where id=#{id}
|
||
|
</delete>
|
||
|
<!--数据更新-->
|
||
|
<update id="update" parameterType="com.haitongauto.models.pojo.ServiceConfig">
|
||
|
update applet_service_config
|
||
|
<set>
|
||
|
<if test="id != null and id != ''">
|
||
|
id = #{id},
|
||
|
</if>
|
||
|
<if test="config_name != null and config_name != ''">
|
||
|
config_name = #{config_name},
|
||
|
</if>
|
||
|
<if test="config_code != null and config_code != ''">
|
||
|
config_code = #{config_code},
|
||
|
</if>
|
||
|
<if test="config_content != null and config_content != ''">
|
||
|
config_content = #{config_content},
|
||
|
</if>
|
||
|
<if test="create_time != null and create_time != ''">
|
||
|
create_time = #{create_time}::timestamp,
|
||
|
</if>
|
||
|
<if test="is_del != null">
|
||
|
is_del = #{is_del},
|
||
|
</if>
|
||
|
update_time = current_timestamp
|
||
|
</set>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
<!--指定Id的记录-->
|
||
|
<select id="getById" parameterType="String" resultType="com.haitongauto.models.pojo.ServiceConfig">
|
||
|
select
|
||
|
id,config_name,config_code,config_content,create_time,update_time,is_del
|
||
|
from applet_service_config
|
||
|
where id=#{id} and is_del=0
|
||
|
</select>
|
||
|
<!--数据列表-->
|
||
|
<select id="getList" resultType="com.haitongauto.models.pojo.ServiceConfig">
|
||
|
select
|
||
|
id,config_name,config_code,config_content,create_time,update_time,is_del
|
||
|
from applet_service_config
|
||
|
where is_del=0
|
||
|
order by create_time desc
|
||
|
</select>
|
||
|
</mapper>
|