jhprjv2/yanzhu-jh/src/main/resources/mapper/project/SurProjectCheckingMapper.xml

166 lines
11 KiB
XML
Raw Normal View History

2023-08-18 17:58:35 +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.SurProjectCheckingMapper">
<resultMap type="SurProjectChecking" id="SurProjectCheckingResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="deptId" column="dept_id" />
<result property="groupDeptId" column="group_dept_id" />
<result property="checkType" column="check_type" />
<result property="mainImage" column="main_image" />
<result property="imageUrls" column="image_urls" />
<result property="workingPositionType" column="working_position_type" />
<result property="checkWorkingPosition" column="check_working_position" />
<result property="checkingNum" column="checking_num" />
<result property="checkResult" column="check_result" />
<result property="intro" column="intro" />
<result property="qualityUser" column="quality_user" />
<result property="qualityUserName" column="quality_user_name" />
<result property="superviseUser" column="supervise_user" />
<result property="superviseUserName" column="supervise_user_name" />
<result property="groupDeptUser" column="group_dept_user" />
<result property="groupDeptUserName" column="group_dept_user_name" />
<result property="checkingDate" column="checking_date" />
<result property="checkingFiles" column="checking_files" />
<result property="isDel" column="is_del" />
<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="selectSurProjectCheckingVo">
select id, project_id, dept_id, group_dept_id, check_type, main_image, image_urls, working_position_type, check_working_position, checking_num, check_result, intro, quality_user, quality_user_name, supervise_user, supervise_user_name, group_dept_user, group_dept_user_name, checking_date, checking_files, is_del, create_by, create_time, update_by, update_time, remark from sur_project_checking
</sql>
<select id="selectSurProjectCheckingList" parameterType="SurProjectChecking" resultMap="SurProjectCheckingResult">
<include refid="selectSurProjectCheckingVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="groupDeptId != null "> and group_dept_id = #{groupDeptId}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="workingPositionType != null and workingPositionType != ''"> and working_position_type = #{workingPositionType}</if>
<if test="checkWorkingPosition != null and checkWorkingPosition != ''"> and check_working_position like concat('%', #{checkWorkingPosition}, '%')</if>
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
<if test="qualityUser != null and qualityUser != ''"> and quality_user like concat('%', #{qualityUser}, '%')</if>
<if test="qualityUserName != null and qualityUserName != ''"> and quality_user_name like concat('%', #{qualityUserName}, '%')</if>
<if test="superviseUser != null and superviseUser != ''"> and supervise_user like concat('%', #{superviseUser}, '%')</if>
<if test="superviseUserName != null and superviseUserName != ''"> and supervise_user_name like concat('%', #{superviseUserName}, '%')</if>
<if test="groupDeptUser != null and groupDeptUser != ''"> and group_dept_user like concat('%', #{groupDeptUser}, '%')</if>
<if test="groupDeptUserName != null and groupDeptUserName != ''"> and group_dept_user_name like concat('%', #{groupDeptUserName}, '%')</if>
<if test="params.beginCheckingDate != null and params.beginCheckingDate != '' and params.endCheckingDate != null and params.endCheckingDate != ''"> and checking_date between #{params.beginCheckingDate} and #{params.endCheckingDate}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectSurProjectCheckingById" parameterType="Long" resultMap="SurProjectCheckingResult">
<include refid="selectSurProjectCheckingVo"/>
where id = #{id}
</select>
<insert id="insertSurProjectChecking" parameterType="SurProjectChecking" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_checking
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="groupDeptId != null">group_dept_id,</if>
<if test="checkType != null">check_type,</if>
<if test="mainImage != null">main_image,</if>
<if test="imageUrls != null">image_urls,</if>
<if test="workingPositionType != null">working_position_type,</if>
<if test="checkWorkingPosition != null">check_working_position,</if>
<if test="checkingNum != null">checking_num,</if>
<if test="checkResult != null">check_result,</if>
<if test="intro != null">intro,</if>
<if test="qualityUser != null">quality_user,</if>
<if test="qualityUserName != null">quality_user_name,</if>
<if test="superviseUser != null">supervise_user,</if>
<if test="superviseUserName != null">supervise_user_name,</if>
<if test="groupDeptUser != null">group_dept_user,</if>
<if test="groupDeptUserName != null">group_dept_user_name,</if>
<if test="checkingDate != null">checking_date,</if>
<if test="checkingFiles != null">checking_files,</if>
<if test="isDel != null">is_del,</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="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="groupDeptId != null">#{groupDeptId},</if>
<if test="checkType != null">#{checkType},</if>
<if test="mainImage != null">#{mainImage},</if>
<if test="imageUrls != null">#{imageUrls},</if>
<if test="workingPositionType != null">#{workingPositionType},</if>
<if test="checkWorkingPosition != null">#{checkWorkingPosition},</if>
<if test="checkingNum != null">#{checkingNum},</if>
<if test="checkResult != null">#{checkResult},</if>
<if test="intro != null">#{intro},</if>
<if test="qualityUser != null">#{qualityUser},</if>
<if test="qualityUserName != null">#{qualityUserName},</if>
<if test="superviseUser != null">#{superviseUser},</if>
<if test="superviseUserName != null">#{superviseUserName},</if>
<if test="groupDeptUser != null">#{groupDeptUser},</if>
<if test="groupDeptUserName != null">#{groupDeptUserName},</if>
<if test="checkingDate != null">#{checkingDate},</if>
<if test="checkingFiles != null">#{checkingFiles},</if>
<if test="isDel != null">#{isDel},</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="updateSurProjectChecking" parameterType="SurProjectChecking">
update sur_project_checking
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="groupDeptId != null">group_dept_id = #{groupDeptId},</if>
<if test="checkType != null">check_type = #{checkType},</if>
<if test="mainImage != null">main_image = #{mainImage},</if>
<if test="imageUrls != null">image_urls = #{imageUrls},</if>
<if test="workingPositionType != null">working_position_type = #{workingPositionType},</if>
<if test="checkWorkingPosition != null">check_working_position = #{checkWorkingPosition},</if>
<if test="checkingNum != null">checking_num = #{checkingNum},</if>
<if test="checkResult != null">check_result = #{checkResult},</if>
<if test="intro != null">intro = #{intro},</if>
<if test="qualityUser != null">quality_user = #{qualityUser},</if>
<if test="qualityUserName != null">quality_user_name = #{qualityUserName},</if>
<if test="superviseUser != null">supervise_user = #{superviseUser},</if>
<if test="superviseUserName != null">supervise_user_name = #{superviseUserName},</if>
<if test="groupDeptUser != null">group_dept_user = #{groupDeptUser},</if>
<if test="groupDeptUserName != null">group_dept_user_name = #{groupDeptUserName},</if>
<if test="checkingDate != null">checking_date = #{checkingDate},</if>
<if test="checkingFiles != null">checking_files = #{checkingFiles},</if>
<if test="isDel != null">is_del = #{isDel},</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="deleteSurProjectCheckingById" parameterType="Long">
delete from sur_project_checking where id = #{id}
</delete>
<delete id="deleteSurProjectCheckingByIds" parameterType="String">
delete from sur_project_checking where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>