YZProjectCloud/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroup...

151 lines
9.3 KiB
XML
Raw Normal View History

2024-08-25 13:31:15 +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.manage.mapper.ProProjectInfoSubdeptsGroupMapper">
<resultMap type="ProProjectInfoSubdeptsGroup" id="ProProjectInfoSubdeptsGroupResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="subDeptId" column="sub_dept_id" />
<result property="subDeptType" column="sub_dept_type" />
<result property="subDeptName" column="sub_dept_name" />
<result property="subDeptCode" column="sub_dept_code" />
<result property="groupName" column="group_name" />
<result property="groupCode" column="group_code" />
<result property="craftType" column="craft_type" />
<result property="craftPost" column="craft_post" />
<result property="groupLeaderName" column="group_leader_name" />
<result property="groupLeaderCode" column="group_leader_code" />
<result property="groupLeaderPhone" column="group_leader_phone" />
<result property="useStatus" column="use_status" />
<result property="approveStatus" column="approve_status" />
<result property="qrCode" column="qr_code" />
<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="selectProProjectInfoSubdeptsGroupVo">
select id, project_id, sub_dept_id, sub_dept_type, sub_dept_name, sub_dept_code, group_name, group_code, craft_type, craft_post, group_leader_name, group_leader_code, group_leader_phone, use_status, approve_status, qr_code, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info_subdepts_group
</sql>
<select id="selectProProjectInfoSubdeptsGroupList" parameterType="ProProjectInfoSubdeptsGroup" resultMap="ProProjectInfoSubdeptsGroupResult">
<include refid="selectProProjectInfoSubdeptsGroupVo"/>
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
<if test="subDeptType != null and subDeptType != ''"> and sub_dept_type = #{subDeptType}</if>
<if test="subDeptName != null and subDeptName != ''"> and sub_dept_name like concat('%', #{subDeptName}, '%')</if>
<if test="subDeptCode != null and subDeptCode != ''"> and sub_dept_code = #{subDeptCode}</if>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="groupCode != null and groupCode != ''"> and group_code = #{groupCode}</if>
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
<if test="groupLeaderName != null and groupLeaderName != ''"> and group_leader_name like concat('%', #{groupLeaderName}, '%')</if>
<if test="groupLeaderCode != null and groupLeaderCode != ''"> and group_leader_code = #{groupLeaderCode}</if>
<if test="groupLeaderPhone != null and groupLeaderPhone != ''"> and group_leader_phone = #{groupLeaderPhone}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
<if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectProProjectInfoSubdeptsGroupById" parameterType="Long" resultMap="ProProjectInfoSubdeptsGroupResult">
<include refid="selectProProjectInfoSubdeptsGroupVo"/>
where id = #{id}
</select>
<insert id="insertProProjectInfoSubdeptsGroup" parameterType="ProProjectInfoSubdeptsGroup" useGeneratedKeys="true" keyProperty="id">
insert into pro_project_info_subdepts_group
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="subDeptId != null">sub_dept_id,</if>
<if test="subDeptType != null">sub_dept_type,</if>
<if test="subDeptName != null">sub_dept_name,</if>
<if test="subDeptCode != null">sub_dept_code,</if>
<if test="groupName != null">group_name,</if>
<if test="groupCode != null">group_code,</if>
<if test="craftType != null">craft_type,</if>
<if test="craftPost != null">craft_post,</if>
<if test="groupLeaderName != null">group_leader_name,</if>
<if test="groupLeaderCode != null">group_leader_code,</if>
<if test="groupLeaderPhone != null">group_leader_phone,</if>
<if test="useStatus != null">use_status,</if>
<if test="approveStatus != null">approve_status,</if>
<if test="qrCode != null">qr_code,</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="subDeptId != null">#{subDeptId},</if>
<if test="subDeptType != null">#{subDeptType},</if>
<if test="subDeptName != null">#{subDeptName},</if>
<if test="subDeptCode != null">#{subDeptCode},</if>
<if test="groupName != null">#{groupName},</if>
<if test="groupCode != null">#{groupCode},</if>
<if test="craftType != null">#{craftType},</if>
<if test="craftPost != null">#{craftPost},</if>
<if test="groupLeaderName != null">#{groupLeaderName},</if>
<if test="groupLeaderCode != null">#{groupLeaderCode},</if>
<if test="groupLeaderPhone != null">#{groupLeaderPhone},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="approveStatus != null">#{approveStatus},</if>
<if test="qrCode != null">#{qrCode},</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="updateProProjectInfoSubdeptsGroup" parameterType="ProProjectInfoSubdeptsGroup">
update pro_project_info_subdepts_group
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="subDeptId != null">sub_dept_id = #{subDeptId},</if>
<if test="subDeptType != null">sub_dept_type = #{subDeptType},</if>
<if test="subDeptName != null">sub_dept_name = #{subDeptName},</if>
<if test="subDeptCode != null">sub_dept_code = #{subDeptCode},</if>
<if test="groupName != null">group_name = #{groupName},</if>
<if test="groupCode != null">group_code = #{groupCode},</if>
<if test="craftType != null">craft_type = #{craftType},</if>
<if test="craftPost != null">craft_post = #{craftPost},</if>
<if test="groupLeaderName != null">group_leader_name = #{groupLeaderName},</if>
<if test="groupLeaderCode != null">group_leader_code = #{groupLeaderCode},</if>
<if test="groupLeaderPhone != null">group_leader_phone = #{groupLeaderPhone},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
<if test="qrCode != null">qr_code = #{qrCode},</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="deleteProProjectInfoSubdeptsGroupById" parameterType="Long">
delete from pro_project_info_subdepts_group where id = #{id}
</delete>
<delete id="deleteProProjectInfoSubdeptsGroupByIds" parameterType="String">
delete from pro_project_info_subdepts_group where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>