ghy-all/ghy-order/src/main/resources/mapper/order/AfterServiceImgsMapper.xml

87 lines
4.3 KiB
XML
Raw Normal View History

<?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.ghy.order.mapper.AfterServiceImgsMapper">
<resultMap type="AfterServiceImgs" id="AfterServiceImgsResult">
<result property="id" column="id" />
<result property="afterServiceRecordId" column="after_service_record_id" />
<result property="imgUrl" column="img_url" />
<result property="imgUploadBy" column="img_upload_by" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAfterServiceImgsVo">
select id, after_service_record_id, img_url, img_upload_by, create_by, create_time, update_by, update_time, remark from after_service_imgs
</sql>
<select id="selectAfterServiceImgsList" parameterType="AfterServiceImgs" resultMap="AfterServiceImgsResult">
<include refid="selectAfterServiceImgsVo"/>
<where>
<if test="afterServiceRecordId != null "> and after_service_record_id = #{afterServiceRecordId}</if>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="imgUploadBy != null "> and img_upload_by = #{imgUploadBy}</if>
</where>
</select>
<select id="selectAfterServiceImgsById" parameterType="String" resultMap="AfterServiceImgsResult">
<include refid="selectAfterServiceImgsVo"/>
where id = #{id}
</select>
<insert id="insertAfterServiceImgs" parameterType="AfterServiceImgs" useGeneratedKeys="true" keyProperty="id">
insert into after_service_imgs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="afterServiceRecordId != null">after_service_record_id,</if>
<if test="imgUrl != null and imgUrl != ''">img_url,</if>
<if test="imgUploadBy != null">img_upload_by,</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>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="afterServiceRecordId != null">#{afterServiceRecordId},</if>
<if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
<if test="imgUploadBy != null">#{imgUploadBy},</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>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAfterServiceImgs" parameterType="AfterServiceImgs">
update after_service_imgs
<trim prefix="SET" suffixOverrides=",">
<if test="afterServiceRecordId != null">after_service_record_id = #{afterServiceRecordId},</if>
<if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
<if test="imgUploadBy != null">img_upload_by = #{imgUploadBy},</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>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAfterServiceImgsById" parameterType="String">
delete from after_service_imgs where id = #{id}
</delete>
<delete id="deleteAfterServiceImgsByIds" parameterType="String">
delete from after_service_imgs where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>