| 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.huaxu.dao.ThingyearSettingMapper">
- <resultMap type="ThingyearSettingEntity" id="ThingyearSettingResult">
- <result property="id" column="id"/>
- <result property="tenantId" column="tenant_id"/>
- <result property="companyOrgId" column="company_org_id"/>
- <result property="deptOrgId" column="dept_org_id"/>
- <result property="thingType" column="thing_type"/>
- <result property="thingYearType" column="thing_year_type"/>
- <result property="thingCount" column="thing_count"/>
- <result property="remark" column="remark"/>
- <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="thingyearSettingColumns">
- a.id as "id" ,
- a.tenant_id as "tenantId" ,
- a.company_org_id as "companyOrgId" ,
- a.dept_org_id as "deptOrgId" ,
- a.thing_type as "thingType" ,
- a.thing_year_type as "thingYearType" ,
- a.thing_count as "thingCount" ,
- a.remark as "remark" ,
- 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="findThingyearSettingById" resultType="com.huaxu.entity.ThingyearSettingEntity">
- SELECT
- <include refid="thingyearSettingColumns"/>
- FROM sms_thingyear_setting a
- WHERE a.id = #{id} and a.status=1
- </select>
- <!-- 根据获取实体List -->
- <select id="findList" resultType="com.huaxu.entity.ThingyearSettingEntity">
- SELECT
- <include refid="thingyearSettingColumns"/>
- FROM sms_thingyear_setting a
- <where>
- a.status=1
- <if test="thingyearSetting.tenantId != null and thingyearSetting.tenantId != ''">and a.tenant_id = #{thingyearSetting.tenantId}</if>
- <if test="thingyearSetting.thingType != null ">and a.thing_type = #{thingyearSetting.thingType}</if>
- <if test="thingyearSetting.userType!=null and thingyearSetting.userType!=-999 and thingyearSetting.userType!=-9999 and thingyearSetting.programItems != null and thingyearSetting.programItems.size() > 0">
- <if test="thingyearSetting.permissonType == 5 or thingyearSetting.permissonType == 2">
- and ( a.DEPT_ORG_ID in
- <foreach collection="thingyearSetting.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- or
- a.COMPANY_ORG_ID in
- <foreach collection="v.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- )
- </if>
- <if test="thingyearSetting.permissonType == 4 or thingyearSetting.permissonType == 3">
- and a.DEPT_ORG_ID in
- <foreach collection="thingyearSetting.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- </if>
- <if test="thingyearSetting.permissonType == 1">
- and a.COMPANY_ORG_ID in
- <foreach collection="thingyearSetting.programItems" item="item" open="(" close=")" separator=",">
- #{item.orgId}
- </foreach>
- and (a.DEPT_ORG_ID is null or a.DEPT_ORG_ID =0)
- </if>
- </if>
- </where>
- </select>
- <!-- 根据获取实体 page -->
- <select id="findPage" resultType="com.huaxu.entity.ThingyearSettingEntity">
- SELECT
- <include refid="thingyearSettingColumns"/>
- FROM sms_thingyear_setting a
- <where>
- a.status=1
- <if test="thingyearSetting.tenantId != null and thingyearSetting.tenantId != ''">and a.tenant_id =
- #{thingyearSetting.tenantId}
- </if>
- <if test="thingyearSetting.thingType != null ">and a.thing_type = #{thingyearSetting.thingType}</if>
- </where>
- </select>
- </mapper>
|