112 lines
5.8 KiB
XML
112 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.yanzhu.manage.mapper.ProPhotographyMapper">
|
|
|
|
<resultMap type="ProPhotography" id="ProPhotographyResult">
|
|
<result property="id" column="id" />
|
|
<result property="comId" column="com_id" />
|
|
<result property="comName" column="com_name" />
|
|
<result property="projectId" column="project_id" />
|
|
<result property="projectName" column="project_name" />
|
|
<result property="imageUrl" column="image_url" />
|
|
<result property="videoUrl" column="video_url" />
|
|
<result property="videoDate" column="video_date" />
|
|
<result property="state" column="state" />
|
|
<result property="remark" column="remark" />
|
|
<result property="isDel" column="is_del" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createDate" column="create_date" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateDate" column="update_date" />
|
|
</resultMap>
|
|
|
|
<sql id="selectProPhotographyVo">
|
|
select pp.id, pp.com_id, sd.dept_name as com_name, pp.project_id, pi.project_name, pp.image_url, pp.video_url, pp.video_date, pp.state, pp.remark, pp.is_del, pp.create_by, pp.create_date, pp.update_by, pp.update_date from pro_photography pp
|
|
left join pro_project_info pi on pi.id = pp.project_id
|
|
left join sys_dept sd on sd.dept_id = pp.com_id
|
|
</sql>
|
|
|
|
<select id="selectProPhotographyList" parameterType="ProPhotography" resultMap="ProPhotographyResult">
|
|
<include refid="selectProPhotographyVo"/>
|
|
<where>
|
|
<if test="comId != null "> and pp.com_id = #{comId}</if>
|
|
<if test="projectId != null "> and pp.project_id = #{projectId}</if>
|
|
<if test="activeComId != null "> and pp.com_id = #{activeComId}</if>
|
|
<if test="activeProjectId != null "> and pp.project_id = #{activeProjectId}</if>
|
|
<if test="state != null "> and pp.state = #{state}</if>
|
|
<if test="isDel != null "> and pp.is_del = #{isDel}</if>
|
|
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''"> and create_date between #{params.beginCreateDate} and #{params.endCreateDate}</if>
|
|
and pp.is_del = 0
|
|
</where>
|
|
order by pp.id desc
|
|
</select>
|
|
|
|
<select id="selectProPhotographyById" parameterType="Long" resultMap="ProPhotographyResult">
|
|
<include refid="selectProPhotographyVo"/>
|
|
where pp.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertProPhotography" parameterType="ProPhotography" useGeneratedKeys="true" keyProperty="id">
|
|
insert into pro_photography
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="comId != null">com_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="imageUrl != null">image_url,</if>
|
|
<if test="videoUrl != null">video_url,</if>
|
|
<if test="videoDate != null">video_date,</if>
|
|
<if test="state != null">state,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="isDel != null">is_del,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createDate != null">create_date,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateDate != null">update_date,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="comId != null">#{comId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="imageUrl != null">#{imageUrl},</if>
|
|
<if test="videoUrl != null">#{videoUrl},</if>
|
|
<if test="videoDate != null">#{videoDate},</if>
|
|
<if test="state != null">#{state},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="isDel != null">#{isDel},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createDate != null">#{createDate},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateDate != null">#{updateDate},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateProPhotography" parameterType="ProPhotography">
|
|
update pro_photography
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="comId != null">com_id = #{comId},</if>
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
<if test="imageUrl != null">image_url = #{imageUrl},</if>
|
|
<if test="videoUrl != null">video_url = #{videoUrl},</if>
|
|
<if test="videoDate != null">video_date = #{videoDate},</if>
|
|
<if test="state != null">state = #{state},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createDate != null">create_date = #{createDate},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateDate != null">update_date = #{updateDate},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="deleteProPhotographyById" parameterType="Long">
|
|
update pro_photography set is_del=2 where id = #{id}
|
|
</update>
|
|
|
|
<update id="deleteProPhotographyByIds" parameterType="String">
|
|
update pro_photography set is_del=2 where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper> |