jhprjv2/yanzhu-jh/src/main/resources/mapper/flow/FlowLabourInfoMapper.xml

144 lines
8.2 KiB
XML
Raw Normal View History

2024-04-20 16:19:07 +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.flow.mapper.FlowLabourInfoMapper">
<resultMap type="FlowLabourInfo" id="FlowLabourInfoResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="projectName" column="project_name" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="subDeptId" column="sub_dept_id" />
<result property="subDeptName" column="sub_dept_name" />
<result property="laborName" column="labor_name" />
<result property="laborCardId" column="labor_cardId" />
<result property="laborPhone" column="labor_phone" />
<result property="laborNumber" column="labor_number" />
<result property="laborAmount" column="labor_amount" />
<result property="laborReason" column="labor_reason" />
<result property="files" column="files" />
<result property="approveStatus" column="approve_status" />
<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="selectFlowLabourInfoVo">
select id, project_id, project_name, dept_id, dept_name, sub_dept_id, sub_dept_name, labor_name, labor_cardId, labor_phone, labor_number, labor_amount, labor_reason, files, approve_status, is_del, create_by, create_time, update_by, update_time, remark from flow_labour_info
</sql>
<select id="selectFlowLabourInfoList" parameterType="FlowLabourInfo" resultMap="FlowLabourInfoResult">
<include refid="selectFlowLabourInfoVo"/>
<where>
is_del=0
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
<if test="subDeptName != null and subDeptName != ''"> and sub_dept_name like concat('%', #{subDeptName}, '%')</if>
<if test="laborName != null and laborName != ''"> and labor_name like concat('%', #{laborName}, '%')</if>
<if test="laborCardId != null "> and labor_cardId like concat('%', #{laborCardId}, '%')</if>
<if test="laborPhone != null and laborPhone != ''"> and labor_phone = #{laborPhone}</if>
<if test="approveStatus != null and approveStatus != ''"> and approve_status = #{approveStatus}</if>
<if test='activeName != null and activeName == "MyAwait"'> and approve_status != 100</if>
</where>
order by create_time desc
</select>
<select id="selectFlowLabourInfoById" parameterType="Long" resultMap="FlowLabourInfoResult">
<include refid="selectFlowLabourInfoVo"/>
where id = #{id}
</select>
<insert id="insertFlowLabourInfo" parameterType="FlowLabourInfo" useGeneratedKeys="true" keyProperty="id">
insert into flow_labour_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="projectName != null">project_name,</if>
<if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if>
<if test="subDeptId != null">sub_dept_id,</if>
<if test="subDeptName != null">sub_dept_name,</if>
<if test="laborName != null">labor_name,</if>
<if test="laborCardId != null">labor_cardId,</if>
<if test="laborPhone != null">labor_phone,</if>
<if test="laborNumber != null">labor_number,</if>
<if test="laborAmount != null">labor_amount,</if>
<if test="laborReason != null">labor_reason,</if>
<if test="files != null">files,</if>
<if test="approveStatus != null">approve_status,</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="projectName != null">#{projectName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if>
<if test="subDeptId != null">#{subDeptId},</if>
<if test="subDeptName != null">#{subDeptName},</if>
<if test="laborName != null">#{laborName},</if>
<if test="laborCardId != null">#{laborCardId},</if>
<if test="laborPhone != null">#{laborPhone},</if>
<if test="laborNumber != null">#{laborNumber},</if>
<if test="laborAmount != null">#{laborAmount},</if>
<if test="laborReason != null">#{laborReason},</if>
<if test="files != null">#{files},</if>
<if test="approveStatus != null">#{approveStatus},</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="updateFlowLabourInfo" parameterType="FlowLabourInfo">
update flow_labour_info
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="projectName != null">project_name = #{projectName},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="deptName != null">dept_name = #{deptName},</if>
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
<if test="subDeptName != null">sub_dept_name = #{subDeptName},</if>
<if test="laborName != null">labor_name = #{laborName},</if>
<if test="laborCardId != null">labor_cardId = #{laborCardId},</if>
<if test="laborPhone != null">labor_phone = #{laborPhone},</if>
<if test="laborNumber != null">labor_number = #{laborNumber},</if>
<if test="laborAmount != null">labor_amount = #{laborAmount},</if>
<if test="laborReason != null">labor_reason = #{laborReason},</if>
<if test="files != null">files = #{files},</if>
<if test="approveStatus != null">approve_status = #{approveStatus},</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="deleteFlowLabourInfoById" parameterType="Long">
delete from flow_labour_info where id = #{id}
</delete>
<delete id="deleteFlowLabourInfoByIds" parameterType="String">
delete from flow_labour_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>