123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?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.OrgSuperviseMapper">
- <resultMap id="OrgSuperviseDtoResultMap" type="com.zhyc.xps.sys.dto.OrgSuperviseDto">
- <result column="org_id" property="orgId" jdbcType="BIGINT" />
- <result column="org_name" property="orgName" jdbcType="VARCHAR" />
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="oc_name" property="ocName" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="OrgSuperviseDto_Cols">
- A.org_id,
- B.oc_name AS org_name,
- A.oc_id,
- C.oc_name
- </sql>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="OrgSuperviseDtoResultMap" >
- SELECT
- <include refid="OrgSuperviseDto_Cols"/>
- FROM org_supervise AS A
- LEFT JOIN oc AS B ON (A.org_id = B.oc_id)
- LEFT JOIN oc AS C ON (A.oc_id = C.oc_id)
- WHERE A.deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND B.oc_name like "%"#{keywords}"%"
- </if>
- <if test="orgId != null">
- AND A.org_id = #{orgId}
- </if>
- <if test="ocId != null">
- AND A.oc_id = #{ocId}
- </if>
- </select>
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.OrgSupervise">
- INSERT INTO org_supervise
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="superviseId != null">
- supervise_id,
- </if>
- <if test="orgId != null">
- org_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="superviseId != null">
- #{superviseId ,jdbcType=BIGINT},
- </if>
- <if test="orgId != null">
- #{orgId ,jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE org_supervise
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag, jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime, jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy, jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="superviseId != null">
- AND supervise_id = #{superviseId ,jdbcType=BIGINT}
- </if>
- <if test="orgId != null">
- AND org_id = #{orgId ,jdbcType=BIGINT}
- </if>
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|