12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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.huaxu.evaluation.dao.EvaluationGradeMapper">
- <resultMap type="com.huaxu.evaluation.entity.EvaluationGradeEntity" id="EvaluationGradeResult">
- <result property="id" column="id"/>
- <result property="tenantId" column="tenant_id"/>
- <result property="companyOrgId" column="company_org_id"/>
- <result property="evaluationGrade" column="evaluation_grade"/>
- <result property="type" column="type"/>
- <result property="valueOne" column="value_one"/>
- <result property="valueTwo" column="value_two"/>
- <result property="remarks" column="remarks"/>
- <result property="status" column="status"/>
- <result property="dateCreate" column="date_create"/>
- <result property="createBy" column="create_by"/>
- <result property="dateUpdate" column="date_update"/>
- <result property="updateBy" column="update_by"/>
- </resultMap>
- <!-- 实体栏位 -->
- <sql id="evaluationGradeColumns">
- a.id as "id" ,
- a.tenant_id as "tenantId" ,
- a.company_org_id as "companyOrgId" ,
- a.evaluation_grade as "evaluationGrade" ,
- a.type as "type" ,
- a.value_one as "valueOne" ,
- a.value_two as "valueTwo" ,
- a.remarks as "remarks" ,
- a.status as "status" ,
- a.date_create as "dateCreate" ,
- a.create_by as "createBy" ,
- a.date_update as "dateUpdate" ,
- a.update_by as "updateBy"
- </sql>
- <!-- 根据主键获取实体 -->
- <select id="findEvaluationGradeById" resultType="com.huaxu.evaluation.entity.EvaluationGradeEntity">
- SELECT
- <include refid="evaluationGradeColumns"/>
- FROM sc_evaluation_grade a
- WHERE a.id = #{id} and a.status=1
- </select>
- <!-- 根据获取实体List -->
- <select id="findList" resultType="com.huaxu.evaluation.entity.EvaluationGradeEntity">
- SELECT
- <include refid="evaluationGradeColumns"/>
- FROM sc_evaluation_grade a
- <where>
- <if test="companyOrgId!=null">
- and a.COMPANY_ORG_ID = #{companyOrgId}
- </if>
- <if test="evaluationGrade != null ">and a.evaluation_grade = #{evaluationGrade}</if>
- <if test="tenantId != null ">and a.tenantId = #{tenantId}</if>
- and a.status=1
- </where>
- </select>
- <!-- 根据获取实体 page -->
- <select id="findPage" resultType="com.huaxu.evaluation.entity.EvaluationGradeEntity">
- SELECT
- <include refid="evaluationGradeColumns"/>
- FROM sc_evaluation_grade a
- <where>
- <if test="evaluationGrade.companyOrgId!=null">
- and a.COMPANY_ORG_ID = #{evaluationGrade.companyOrgId}
- </if>
- <if test="evaluationGrade.evaluationGrade != null ">and a.evaluation_grade =
- #{evaluationGrade.evaluationGrade}
- </if>
- <if test="evaluationGrade.tenantId != null ">and a.tenantId = #{evaluationGrade.tenantId}</if>
- and a.status=1
- <if test="evaluationGrade.userType!=null and evaluationGrade.userType!=-999 and evaluationGrade.userType!=-9999 and evaluationGrade.programItems != null and evaluationGrade.programItems.size() > 0">
- <if test="evaluationGrade.permissonType == 5 or evaluationGrade.permissonType == 2">
- and
- a.COMPANY_ORG_ID in
- <foreach collection="evaluationGrade.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- </if>
- <if test="evaluationGrade.permissonType == 1">
- and a.COMPANY_ORG_ID in
- <foreach collection="evaluationGrade.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- </if>
- </if>
- </where>
- </select>
- </mapper>
|