TInsuranceAreaResMapper.xml 4.83 KB
Newer Older
fangxinjiang's avatar
fangxinjiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~
  ~      Copyright (c) 2018-2025, lengleng All rights reserved.
  ~
  ~  Redistribution and use in source and binary forms, with or without
  ~  modification, are permitted provided that the following conditions are met:
  ~
  ~ Redistributions of source code must retain the above copyright notice,
  ~  this list of conditions and the following disclaimer.
  ~  Redistributions in binary form must reproduce the above copyright
  ~  notice, this list of conditions and the following disclaimer in the
  ~  documentation and/or other materials provided with the distribution.
  ~  Neither the name of the yifu4cloud.com developer nor the names of its
  ~  contributors may be used to endorse or promote products derived from
  ~  this software without specific prior written permission.
  ~  Author: lengleng (wangiegie@gmail.com)
  ~
  -->

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceAreaResMapper">

	<resultMap id="tInsuranceAreaResMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes">
		<id property="id" column="ID"/>
		<result property="userId" column="USER_ID"/>
		<result property="province" column="PROVINCE"/>
		<result property="city" column="CITY"/>
		<result property="userName" column="USER_NAME"/>
		<result property="status" column="STATUS"/>
		<result property="organName" column="ORGAN_NAME"/>
	</resultMap>
	<resultMap id="insuranceAreaResExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo">
		<result property="province" column="PROVINCE"/>
		<result property="city" column="CITY"/>
		<result property="userName" column="USER_NAME"/>
		<result property="status" column="STATUS"/>
		<result property="organName" column="ORGAN_NAME"/>
	</resultMap>
	<sql id="Base_Column_List">
		a.ID,
		a.USER_ID,
		a.PROVINCE,
		a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
	</sql>
	<sql id="tInsuranceAreaRes_where">
		<if test="tInsuranceAreaRes != null">
			<if test="tInsuranceAreaRes.id != null and tInsuranceAreaRes.id.trim() != ''">
				AND a.ID = #{tInsuranceAreaRes.id}
			</if>
			<if test="tInsuranceAreaRes.userId != null and tInsuranceAreaRes.userId.trim() != ''">
				AND a.USER_ID = #{tInsuranceAreaRes.userId}
			</if>
			<if test="tInsuranceAreaRes.province != null">
				AND a.PROVINCE = #{tInsuranceAreaRes.province}
			</if>
			<if test="tInsuranceAreaRes.city != null">
				AND a.CITY = #{tInsuranceAreaRes.city}
			</if>
			<if test="tInsuranceAreaRes.status!= null">
				AND a.status like CONCAT(#{tInsuranceAreaRes.status},'%')
			</if>
			<if test="tInsuranceAreaRes.userName != null">
fangxinjiang's avatar
fangxinjiang committed
66
				AND a.USER_NAME  like CONCAT('%',#{tInsuranceAreaRes.userName},'%')
fangxinjiang's avatar
fangxinjiang committed
67 68
			</if>
			<if test="tInsuranceAreaRes.organName != null">
fangxinjiang's avatar
fangxinjiang committed
69
				AND a.ORGAN_NAME  like CONCAT('%',#{tInsuranceAreaRes.organName},'%')
fangxinjiang's avatar
fangxinjiang committed
70 71 72 73 74 75 76 77 78 79 80
			</if>
		</if>
	</sql>
	<!--tInsuranceAreaRes简单分页查询-->
	<select id="getTInsuranceAreaResPage" resultMap="tInsuranceAreaResMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_insurance_area_res a
		<where>
			1=1
			<include refid="tInsuranceAreaRes_where"/>
fangxinjiang's avatar
fangxinjiang committed
81
			order by a.CREATE_TIME desc
fangxinjiang's avatar
fangxinjiang committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
		</where>
	</select>
	<select id="noPageDiy" resultMap="insuranceAreaResExportMap">
		SELECT
		a.PROVINCE,
		a.CITY,a.USER_NAME,a.STATUS,a.ORGAN_NAME
		FROM t_insurance_area_res a
		<where>
			1=1
			<include refid="export_where"/>
			<if test="tInsuranceAreaRes != null">
				<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
					${tHaveSalaryNosocial.authSql}
				</if>
				<if test="tInsuranceAreaRes.limitStart != null">
					limit #{tInsuranceAreaRes.limitStart},#{tInsuranceAreaRes.limitEnd}
				</if>
			</if>
		</where>
	</select>
	<select id="noPageCountDiy"  resultType="java.lang.Integer">
		SELECT
		count(1)
		FROM t_insurance_area_res a
		<where>
			1=1
			<include refid="export_where"/>
			<if test="tInsuranceAreaRes.authSql != null and tInsuranceAreaRes.authSql.trim() != ''">
				${tInsuranceAreaRes.authSql}
			</if>
		</where>
	</select>
	<sql id="export_where">
		<include refid="tInsuranceAreaRes_where"/>
		<if test="idsStr != null and idsStr.size > 0">
			AND a.ID in
			<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
				#{items}
			</foreach>
		</if>
		<!--数据权限判断-->
		<if test="settleDomainIds != null">
			<if test="settleDomainIds.size() > 0">
				and a.SETTLE_DOMAIN_ID in
				<foreach collection="settleDomainIds" item="param" index="index" open="(" close=")" separator=",">
					#{param}
				</foreach>
			</if>
			<if test="settleDomainIds.size() == 0">
				and 1=2
			</if>
		</if>
		<if test="settleDomainIds == null">
			and 1=1
		</if>
		<if test='sql != null and sql != ""'>
			and <![CDATA[sql]]>
		</if>
	</sql>
</mapper>