jhprjv2/yanzhu-jh/src/main/resources/mapper/project/SurProjectWorkingCommitteeM...

96 lines
5.0 KiB
XML
Raw Normal View History

2024-04-08 23:34:32 +08:00
<?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.jh.project.mapper.SurProjectWorkingCommitteeMapper">
<resultMap type="SurProjectWorkingCommittee" id="SurProjectWorkingCommitteeResult">
<result property="id" column="id" />
<result property="committeeId" column="committeeId" />
<result property="projectId" column="projectId" />
<result property="workingType" column="workingType" />
<result property="costName" column="costName" />
<result property="money" column="money" />
<result property="remark" column="remark" />
<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="selectSurProjectWorkingCommitteeVo">
select id, committeeId, projectId, workingType, costName, money, remark, create_by, create_time, update_by, update_time from sur_project_working_committee
</sql>
<select id="selectSurProjectWorkingCommitteeList" parameterType="SurProjectWorkingCommittee" resultMap="SurProjectWorkingCommitteeResult">
<include refid="selectSurProjectWorkingCommitteeVo"/>
<where>
<if test="committeeId != null "> and committeeId = #{committeeId}</if>
<if test="projectId != null "> and projectId = #{projectId}</if>
<if test="workingType != null "> and workingType = #{workingType}</if>
<if test="costName != null and costName != ''"> and costName like concat('%', #{costName}, '%')</if>
<if test="money != null "> and money = #{money}</if>
</where>
</select>
<select id="selectSurProjectWorkingCommitteeById" parameterType="Long" resultMap="SurProjectWorkingCommitteeResult">
<include refid="selectSurProjectWorkingCommitteeVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectWorkingCommittee" parameterType="SurProjectWorkingCommittee" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_working_committee
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="committeeId != null">committeeId,</if>
<if test="projectId != null">projectId,</if>
<if test="workingType != null">workingType,</if>
<if test="costName != null">costName,</if>
<if test="money != null">money,</if>
<if test="remark != null">remark,</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="committeeId != null">#{committeeId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="workingType != null">#{workingType},</if>
<if test="costName != null">#{costName},</if>
<if test="money != null">#{money},</if>
<if test="remark != null">#{remark},</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="updateSurProjectWorkingCommittee" parameterType="SurProjectWorkingCommittee">
update sur_project_working_committee
<trim prefix="SET" suffixOverrides=",">
<if test="committeeId != null">committeeId = #{committeeId},</if>
<if test="projectId != null">projectId = #{projectId},</if>
<if test="workingType != null">workingType = #{workingType},</if>
<if test="costName != null">costName = #{costName},</if>
<if test="money != null">money = #{money},</if>
<if test="remark != null">remark = #{remark},</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 id = #{id}
</update>
<delete id="deleteSurProjectWorkingCommitteeById" parameterType="Long">
delete from sur_project_working_committee where id = #{id}
</delete>
<delete id="deleteSurProjectWorkingCommitteeByIds" parameterType="String">
delete from sur_project_working_committee where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>