mcwl-ai/mcwl-comment/src/main/resources/mapper/comment/CommentMapper.xml

58 lines
1.7 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.mcwl.comment.mapper.CommentMapper">
<insert id="insert">
insert into mall_product_comment(id, parent_id, product_id, user_id, content, rating, create_by, create_time,
update_by, update_time, del_flag, remark)
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
#{updateBy}, #{updateTime}, #{remark}, #{delFlag})
</insert>
<update id="upda"></update>
<delete id="deleteByIds">
delete
from model
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="findById" resultType="com.mcwl.resource.domain.ModelProduct">
select
id,
parent_id,
product_id,
user_id,
content,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag
from model
where id = #{id}
</select>
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
select
id,
parent_id,
product_id,
user_id,
content,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag
from mall_product_comment
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>