101 lines
5.8 KiB
XML
101 lines
5.8 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.bonus.canteen.core.basic.mapper.BasicCanteenSuggestionMapper">
|
||
|
|
<resultMap type="com.bonus.canteen.core.basic.domain.BasicCanteenSuggestion" id="BasicCanteenSuggestionResult">
|
||
|
|
<result property="suggestionId" column="suggestion_id" />
|
||
|
|
<result property="userId" column="user_id" />
|
||
|
|
<result property="content" column="content" />
|
||
|
|
<result property="canteenId" column="canteen_id" />
|
||
|
|
<result property="contactTel" column="contact_tel" />
|
||
|
|
<result property="replyContent" column="reply_content" />
|
||
|
|
<result property="replyState" column="reply_state" />
|
||
|
|
<result property="replyUserId" column="reply_user_id" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectBasicCanteenSuggestionVo">
|
||
|
|
select suggestion_id, user_id, content, canteen_id, contact_tel, reply_content, reply_state, reply_user_id, create_by, create_time, update_by, update_time from basic_canteen_suggestion
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectBasicCanteenSuggestionList" parameterType="com.bonus.canteen.core.basic.domain.BasicCanteenSuggestion" resultMap="BasicCanteenSuggestionResult">
|
||
|
|
<include refid="selectBasicCanteenSuggestionVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||
|
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
||
|
|
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||
|
|
<if test="contactTel != null and contactTel != ''"> and contact_tel = #{contactTel}</if>
|
||
|
|
<if test="replyContent != null and replyContent != ''"> and reply_content = #{replyContent}</if>
|
||
|
|
<if test="replyState != null "> and reply_state = #{replyState}</if>
|
||
|
|
<if test="replyUserId != null "> and reply_user_id = #{replyUserId}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectBasicCanteenSuggestionBySuggestionId" parameterType="Long" resultMap="BasicCanteenSuggestionResult">
|
||
|
|
<include refid="selectBasicCanteenSuggestionVo"/>
|
||
|
|
where suggestion_id = #{suggestionId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertBasicCanteenSuggestion" parameterType="com.bonus.canteen.core.basic.domain.BasicCanteenSuggestion" useGeneratedKeys="true" keyProperty="suggestionId">
|
||
|
|
insert into basic_canteen_suggestion
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="userId != null">user_id,</if>
|
||
|
|
<if test="content != null and content != ''">content,</if>
|
||
|
|
<if test="canteenId != null">canteen_id,</if>
|
||
|
|
<if test="contactTel != null">contact_tel,</if>
|
||
|
|
<if test="replyContent != null">reply_content,</if>
|
||
|
|
<if test="replyState != null">reply_state,</if>
|
||
|
|
<if test="replyUserId != null">reply_user_id,</if>
|
||
|
|
<if test="createBy != null">create_by,</if>
|
||
|
|
<if test="createTime != null">create_time,</if>
|
||
|
|
<if test="updateBy != null">update_by,</if>
|
||
|
|
<if test="updateTime != null">update_time,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="userId != null">#{userId},</if>
|
||
|
|
<if test="content != null and content != ''">#{content},</if>
|
||
|
|
<if test="canteenId != null">#{canteenId},</if>
|
||
|
|
<if test="contactTel != null">#{contactTel},</if>
|
||
|
|
<if test="replyContent != null">#{replyContent},</if>
|
||
|
|
<if test="replyState != null">#{replyState},</if>
|
||
|
|
<if test="replyUserId != null">#{replyUserId},</if>
|
||
|
|
<if test="createBy != null">#{createBy},</if>
|
||
|
|
<if test="createTime != null">#{createTime},</if>
|
||
|
|
<if test="updateBy != null">#{updateBy},</if>
|
||
|
|
<if test="updateTime != null">#{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateBasicCanteenSuggestion" parameterType="com.bonus.canteen.core.basic.domain.BasicCanteenSuggestion">
|
||
|
|
update basic_canteen_suggestion
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="userId != null">user_id = #{userId},</if>
|
||
|
|
<if test="content != null and content != ''">content = #{content},</if>
|
||
|
|
<if test="canteenId != null">canteen_id = #{canteenId},</if>
|
||
|
|
<if test="contactTel != null">contact_tel = #{contactTel},</if>
|
||
|
|
<if test="replyContent != null">reply_content = #{replyContent},</if>
|
||
|
|
<if test="replyState != null">reply_state = #{replyState},</if>
|
||
|
|
<if test="replyUserId != null">reply_user_id = #{replyUserId},</if>
|
||
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||
|
|
</trim>
|
||
|
|
where suggestion_id = #{suggestionId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteBasicCanteenSuggestionBySuggestionId" parameterType="Long">
|
||
|
|
delete from basic_canteen_suggestion where suggestion_id = #{suggestionId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteBasicCanteenSuggestionBySuggestionIds" parameterType="String">
|
||
|
|
delete from basic_canteen_suggestion where suggestion_id in
|
||
|
|
<foreach item="suggestionId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{suggestionId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|