TIncomeDetailMapper.xml 6.37 KB
Newer Older
hongguangwu's avatar
hongguangwu 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
<?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.social.mapper.TIncomeDetailMapper">

	<resultMap id="tIncomeDetailMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail">
		<id property="id" column="ID"/>
		<result property="empName" column="EMP_NAME"/>
		<result property="empIdcard" column="EMP_IDCARD"/>
		<result property="unitId" column="UNIT_ID"/>
		<result property="unitName" column="UNIT_NAME"/>
		<result property="unitNo" column="UNIT_NO"/>
		<result property="deptId" column="DEPT_ID"/>
		<result property="deptName" column="DEPT_NAME"/>
		<result property="deptNo" column="DEPT_NO"/>
		<result property="feeType" column="FEE_TYPE"/>
		<result property="feeMode" column="FEE_MODE"/>
		<result property="charges" column="CHARGES"/>
		<result property="sourceType" column="SOURCE_TYPE"/>
		<result property="money" column="MONEY"/>
		<result property="createMonth" column="CREATE_MONTH"/>
		<result property="payMonth" column="PAY_MONTH"/>
		<result property="createTime" column="CREATE_TIME"/>
		<result property="dataCreateMonth" column="DATA_CREATE_MONTH"/>
		<result property="sourceId" column="SOURCE_ID"/>
hongguangwu's avatar
hongguangwu committed
46
		<result property="redData" column="RED_DATA"/>
hongguangwu's avatar
hongguangwu committed
47
		<result property="mrSettleType" column="MR_SETTLE_TYPE"/>
48
		<result property="applyNo" column="APPLY_NO"/>
hongguangwu's avatar
hongguangwu committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
	</resultMap>
	<sql id="Base_Column_List">
		a.ID,
		a.EMP_NAME,
		a.EMP_IDCARD,
		a.UNIT_ID,
		a.UNIT_NAME,
		a.UNIT_NO,
		a.DEPT_ID,
		a.DEPT_NAME,
		a.DEPT_NO,
		a.FEE_TYPE,
		a.FEE_MODE,
		a.CHARGES,
		a.SOURCE_TYPE,
		a.MONEY,
		a.CREATE_MONTH,
		a.PAY_MONTH,
		a.CREATE_TIME,
		a.DATA_CREATE_MONTH,
hongguangwu's avatar
hongguangwu committed
69
		a.SOURCE_ID,
hongguangwu's avatar
hongguangwu committed
70
		a.RED_DATA,
71 72
		a.MR_SETTLE_TYPE,
		a.APPLY_NO
hongguangwu's avatar
hongguangwu committed
73 74 75 76 77 78 79 80 81 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
	</sql>
	<sql id="tIncomeDetail_where">
		<if test="tIncomeDetail != null">
			<if test="tIncomeDetail.id != null and tIncomeDetail.id.trim() != ''">
				AND a.ID = #{tIncomeDetail.id}
			</if>
			<if test="tIncomeDetail.empName != null and tIncomeDetail.empName.trim() != ''">
				AND a.EMP_NAME = #{tIncomeDetail.empName}
			</if>
			<if test="tIncomeDetail.empIdcard != null and tIncomeDetail.empIdcard.trim() != ''">
				AND a.EMP_IDCARD = #{tIncomeDetail.empIdcard}
			</if>
			<if test="tIncomeDetail.unitId != null and tIncomeDetail.unitId.trim() != ''">
				AND a.UNIT_ID = #{tIncomeDetail.unitId}
			</if>
			<if test="tIncomeDetail.unitName != null and tIncomeDetail.unitName.trim() != ''">
				AND a.UNIT_NAME = #{tIncomeDetail.unitName}
			</if>
			<if test="tIncomeDetail.unitNo != null and tIncomeDetail.unitNo.trim() != ''">
				AND a.UNIT_NO = #{tIncomeDetail.unitNo}
			</if>
			<if test="tIncomeDetail.deptId != null and tIncomeDetail.deptId.trim() != ''">
				AND a.DEPT_ID = #{tIncomeDetail.deptId}
			</if>
			<if test="tIncomeDetail.deptName != null and tIncomeDetail.deptName.trim() != ''">
				AND a.DEPT_NAME = #{tIncomeDetail.deptName}
			</if>
			<if test="tIncomeDetail.deptNo != null and tIncomeDetail.deptNo.trim() != ''">
				AND a.DEPT_NO = #{tIncomeDetail.deptNo}
			</if>
			<if test="tIncomeDetail.feeType != null and tIncomeDetail.feeType.trim() != ''">
				AND a.FEE_TYPE = #{tIncomeDetail.feeType}
			</if>
			<if test="tIncomeDetail.feeMode != null and tIncomeDetail.feeMode.trim() != ''">
				AND a.FEE_MODE = #{tIncomeDetail.feeMode}
			</if>
			<if test="tIncomeDetail.charges != null and tIncomeDetail.charges.trim() != ''">
				AND a.CHARGES = #{tIncomeDetail.charges}
			</if>
			<if test="tIncomeDetail.sourceType != null and tIncomeDetail.sourceType.trim() != ''">
				AND a.SOURCE_TYPE = #{tIncomeDetail.sourceType}
			</if>
			<if test="tIncomeDetail.money != null">
				AND a.MONEY = #{tIncomeDetail.money}
			</if>
			<if test="tIncomeDetail.createMonth != null and tIncomeDetail.createMonth.trim() != ''">
				AND a.CREATE_MONTH = #{tIncomeDetail.createMonth}
			</if>
			<if test="tIncomeDetail.payMonth != null and tIncomeDetail.payMonth.trim() != ''">
				AND a.PAY_MONTH = #{tIncomeDetail.payMonth}
			</if>
			<if test="tIncomeDetail.createTime != null">
				AND a.CREATE_TIME = #{tIncomeDetail.createTime}
			</if>
			<if test="tIncomeDetail.dataCreateMonth != null and tIncomeDetail.dataCreateMonth.trim() != ''">
				AND a.DATA_CREATE_MONTH = #{tIncomeDetail.dataCreateMonth}
			</if>
			<if test="tIncomeDetail.sourceId != null and tIncomeDetail.sourceId.trim() != ''">
				AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
			</if>
hongguangwu's avatar
hongguangwu committed
133 134 135
			<if test="tIncomeDetail.redData != null and tIncomeDetail.redData.trim() != ''">
				AND a.RED_DATA = #{tIncomeDetail.redData}
			</if>
136 137 138
			<if test="tIncomeDetail.applyNo != null and tIncomeDetail.applyNo.trim() != ''">
				AND a.APPLY_NO = #{tIncomeDetail.applyNo}
			</if>
hongguangwu's avatar
hongguangwu committed
139 140 141 142 143 144
			<if test="tIncomeDetail.idCardList != null and tIncomeDetail.idCardList.size() > 0">
				AND a.EMP_IDCARD in
				<foreach item="item" index="index" collection="tIncomeDetail.idCardList" open="(" separator="," close=")">
					#{item}
				</foreach>
			</if>
hongguangwu's avatar
hongguangwu committed
145 146 147
		</if>
	</sql>

hongguangwu's avatar
hongguangwu committed
148 149 150 151 152 153 154 155 156 157 158
	<!-- 列表 -->
	<select id="getTIncomeDetailList" resultMap="tIncomeDetailMap">
		SELECT
		<include refid="Base_Column_List"/>
		FROM t_income_detail a
		<where>
			1=1
			<include refid="tIncomeDetail_where"/>
		</where>
	</select>

hongguangwu's avatar
hongguangwu committed
159 160 161 162 163 164 165 166 167 168 169 170
	<!-- 获取重复性 -->
	<select id="getTIncomeDetailRepeat" resultType="java.lang.Integer">
		SELECT
			count(1)
		FROM t_income_detail a
		where	a.ID !=  #{tIncomeDetail.id}
				AND a.SOURCE_ID = #{tIncomeDetail.sourceId}
				AND a.MONEY = #{tIncomeDetail.money}
				AND a.RED_DATA = #{tIncomeDetail.redData}
				AND a.FEE_TYPE = #{tIncomeDetail.feeType}
	</select>

hongguangwu's avatar
hongguangwu committed
171
</mapper>