lanan-system/dl-module-jx/src/main/resources/mapper/jx/DriveSchoolFeedbackMapper.xml
2024-08-26 23:44:25 +08:00

148 lines
7.2 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="cn.iocoder.yudao.module.jx.mapper.DriveSchoolFeedbackMapper">
<resultMap type="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" id="DriveSchoolFeedbackResult">
<result property="id" column="id" />
<result property="userId" column="userId" />
<result property="content" column="content" />
<result property="jlContent" column="jlContent" />
<result property="jlId" column="jlId" />
<result property="jlName" column="jlName" />
<result property="jxId" column="jxId" />
<result property="jxName" column="jxName" />
<result property="createTime" column="create_time" />
<result property="creator" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updater" column="update_by" />
<result property="evaluateType" column="evaluateType" />
<result property="userName" column="userName" />
<result property="likes" column="likes" />
</resultMap>
<sql id="selectDriveSchoolFeedbackVo">
select * from drive_school_feedback
</sql>
<select id="selectDriveSchoolFeedbackList" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultMap="DriveSchoolFeedbackResult">
<include refid="selectDriveSchoolFeedbackVo"/>
<where>
<if test="entity.userId != null "> and userId = #{entity.userId}</if>
<if test="entity.jxName != null and entity.jxName != ''"> and jxName like concat('%',#{entity.jxName},'%') </if>
<if test="entity.jlName != null and entity.jlName != ''"> and jlName like concat('%',#{entity.jlName},'%')</if>
<if test="entity.evaluateType != null "> and evaluateType = #{entity.evaluateType}</if>
</where>
order by create_time desc
</select>
<select id="selectDriveSchoolFeedbackListAll" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultMap="DriveSchoolFeedbackResult">
<include refid="selectDriveSchoolFeedbackVo"/>
<where>
<if test="entity.userId != null "> and userId = #{entity.userId}</if>
<if test="entity.jxName != null and entity.jxName != ''"> and jxName like concat('%',#{entity.jxName},'%') </if>
<if test="entity.jlName != null and entity.jlName != ''"> and jlName like concat('%',#{entity.jlName},'%')</if>
<if test="entity.evaluateType != null "> and evaluateType = #{entity.evaluateType}</if>
</where>
order by create_time desc
</select>
<select id="likeOne" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
select count(1) total from drive_school_feedback
<where>
likes = '1'
<if test="jxId != null "> and jxId = #{jxId}</if>
</where>
order by create_time desc
</select>
<select id="likeTwo" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
select count(1) total from drive_school_feedback
<where>
likes = '2'
<if test="jxId != null "> and jxId = #{jxId}</if>
</where>
</select>
<select id="likeThree" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback" resultType="Integer">
<include refid="selectDriveSchoolFeedbackVo"/>
select count(1) total from drive_school_feedback
<where>
likes = '3'
<if test="jxId != null "> and jxId = #{jxId}</if>
</where>
</select>
<select id="selectDriveSchoolFeedbackById" parameterType="Long" resultMap="DriveSchoolFeedbackResult">
<include refid="selectDriveSchoolFeedbackVo"/>
where id = #{id}
</select>
<insert id="insertDriveSchoolFeedback" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback">
insert into drive_school_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="userId != null">userId,</if>
<if test="content != null">content,</if>
<if test="jlContent != null">jlContent,</if>
<if test="jlId != null">jlId,</if>
<if test="jlName != null">jlName,</if>
<if test="jxId != null">jxId,</if>
<if test="jxName != null">jxName,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="evaluateType != null">evaluateType,</if>
<if test="userName != null">userName,</if>
<if test="likes!= null">likes,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="userId != null">#{userId},</if>
<if test="content != null">#{content},</if>
<if test="jlContent != null">#{jlContent},</if>
<if test="jlId != null">#{jlId},</if>
<if test="jlName != null">#{jlName},</if>
<if test="jxId != null">#{jxId},</if>
<if test="jxName != null">#{jxName},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="evaluateType != null">#{evaluateType},</if>
<if test="userName != null">#{userName},</if>
<if test="likes != null">#{likes},</if>
</trim>
</insert>
<insert id="insertData">
insert into drive_school_feedback (userId, content, create_time) values (#{userId}, #{content}, now())
</insert>
<update id="updateDriveSchoolFeedback" parameterType="cn.iocoder.yudao.module.jx.domain.DriveSchoolFeedback">
update drive_school_feedback
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">userId = #{userId},</if>
<if test="content != null">content = #{content},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="evaluateType != null">evaluateType = #{evaluateType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDriveSchoolFeedbackById" parameterType="Long">
delete from drive_school_feedback where id = #{id}
</delete>
<delete id="deleteDriveSchoolFeedbackByIds" parameterType="String">
delete from drive_school_feedback where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>