123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <?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.zhyc.xps.sys.mapper.LeadingGroupPositionMapper">
- <resultMap id="LeadingGroupPositionDtoResultMap" type="com.zhyc.xps.sys.dto.LeadingGroupPositionDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="lgp_id" property="lgpId" jdbcType="BIGINT" />
- <result column="lgp_name" property="lgpName" jdbcType="VARCHAR" />
- <result column="lgp_duty" property="lgpDuty" jdbcType="VARCHAR" />
- <result column="lgp_desc" property="lgpDesc" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="LeadingGroupPositionDto_Cols">
- A.oc_id,
- A.lgp_id,
- A.lgp_name,
- A.lgp_duty,
- A.lgp_desc
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="LeadingGroupPositionDtoResultMap">
- SELECT
- <include refid="LeadingGroupPositionDto_Cols"/>
- FROM leading_group_position AS A
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
- AND A.lgp_id = #{lgpId ,jdbcType=BIGINT}
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="LeadingGroupPositionDtoResultMap">
- SELECT
- <include refid="LeadingGroupPositionDto_Cols"/>
- FROM leading_group_position AS A
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="lgpId != null">
- AND A.lgp_id = #{lgpId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.lgp_name LIKE "%"#{keywords}"%"
- </if>
- ORDER BY A.oc_id DESC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="LeadingGroupPositionDtoResultMap">
- SELECT
- <include refid="LeadingGroupPositionDto_Cols"/>
- FROM leading_group_position AS A
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="lgpId != null">
- AND A.lgp_id = #{lgpId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.lgp_name LIKE "%"#{keywords}"%"
- </if>
- </select>
- <!--新增Create-->
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.LeadingGroup">
- INSERT INTO leading_group_position
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="lgpId != null">
- lgp_id,
- </if>
- <if test="lgpName != null and lgpName != ''">
- lgp_name,
- </if>
- <if test="lgpDuty != null and lgpDuty != ''">
- lgp_duty,
- </if>
- <if test="lgpDesc != null and lgpDesc != ''">
- lgp_desc,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null ">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="lgpId != null">
- #{lgpId ,jdbcType=BIGINT},
- </if>
- <if test="lgpName != null and lgpName != ''">
- #{lgpName ,jdbcType=VARCHAR},
- </if>
- <if test="lgpDuty != null and lgpDuty != ''">
- #{lgpDuty ,jdbcType=VARCHAR},
- </if>
- <if test="lgpDesc != null and lgpDesc != ''">
- #{lgpDesc ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.LeadingGroup">
- UPDATE leading_group_position
- <trim suffixOverrides=",">
- <set>
- <if test="lgpName != null and lgpName != ''">
- lgp_name = #{lgpName, jdbcType=VARCHAR},
- </if>
- <if test="lgpDuty != null and lgpDuty != ''">
- lgp_duty = #{lgpDuty ,jdbcType=VARCHAR},
- </if>
- <if test="lgpDesc != null and lgpDesc != ''">
- lgp_desc = #{lgpDesc, jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE oc_Id = #{ocId ,jdbcType=BIGINT}
- AND lgp_id = #{lgpId ,jdbcType=BIGINT}
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE leading_group_position
- <trim prefix="set" suffixOverrides=",">
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedAt != null">
- deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT}
- </if>
- </trim>
- WHERE deleted_flag = 0
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="lgpId != null">
- AND lgp_id = #{lgpId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|