小程序后台代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.9 KiB

<?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.zdxt.knowledge.mapper.QuestionFreMapper">
<resultMap type="com.zdxt.knowledge.domain.QuestionFre" id="QuestionFreResult">
<result property="guid" column="guid" />
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
<result property="creator" column="creator" />
<result property="createTime" column="create_time" />
<result property="updator" column="updator" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectQuestionFreVo">
select guid, user_id, role_id, creator, create_time, updator, update_time from question_fre
</sql>
<select id="selectQuestionFreList" parameterType="QuestionFre" resultMap="QuestionFreResult">
<include refid="selectQuestionFreVo"/>
<where>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="roleId != null and roleId != ''"> and role_id = #{roleId}</if>
<if test="creator != null and creator != ''"> and creator = #{creator}</if>
<if test="updator != null and updator != ''"> and updator = #{updator}</if>
</where>
order by create_time desc
</select>
<select id="selectQuestionFreById" parameterType="String" resultMap="QuestionFreResult">
<include refid="selectQuestionFreVo"/>
where guid = #{guid}
</select>
<insert id="insertQuestionFre" parameterType="QuestionFre">
insert into question_fre
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="guid != null and guid != ''">guid,</if>
<if test="userId != null and userId != ''">user_id,</if>
<if test="roleId != null and roleId != ''">role_id,</if>
<if test="creator != null and creator != ''">creator,</if>
<if test="createTime != null ">create_time,</if>
<if test="updator != null and updator != ''">updator,</if>
<if test="updateTime != null ">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="guid != null and guid != ''">#{guid},</if>
<if test="userId != null and userId != ''">#{userId},</if>
<if test="roleId != null and roleId != ''">#{roleId},</if>
<if test="creator != null and creator != ''">#{creator},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updator != null and updator != ''">#{updator},</if>
<if test="updateTime != null ">#{updateTime},</if>
</trim>
</insert>
<update id="updateQuestionFre" parameterType="QuestionFre">
update question_fre
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="roleId != null and roleId != ''">role_id = #{roleId},</if>
<if test="creator != null and creator != ''">creator = #{creator},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updator != null and updator != ''">updator = #{updator},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
</trim>
where guid = #{guid}
</update>
<delete id="deleteQuestionFreById" parameterType="String">
delete from question_fre where guid = #{guid}
</delete>
<delete id="deleteQuestionFreByIds" parameterType="String">
delete from question_fre where guid in
<foreach item="guid" collection="array" open="(" separator="," close=")">
#{guid}
</foreach>
</delete>
</mapper>