250 lines
16 KiB
XML
250 lines
16 KiB
XML
<?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.xdadan.erp.emis.mapper.EmisSitePrepaidRechargeMapper">
|
|
|
|
<resultMap type="EmisSitePrepaidRecharge" id="EmisSitePrepaidRechargeResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="rechargeSiteCode" column="recharge_site_code" />
|
|
<result property="rechargeAmount" column="recharge_amount" />
|
|
<result property="rechargeType" column="recharge_type" />
|
|
<result property="remittanceType" column="remittance_type" />
|
|
<result property="filePath" column="file_path" />
|
|
<result property="remittanceBank" column="remittance_bank" />
|
|
<result property="remittanceAccountName" column="remittance_account_name" />
|
|
<result property="remittanceCardNo" column="remittance_card_no" />
|
|
<result property="remittanceDate" column="remittance_date" />
|
|
<result property="auditSiteCode" column="audit_site_code" />
|
|
<result property="auditManCode" column="audit_man_code" />
|
|
<result property="auditDate" column="audit_date" />
|
|
<result property="auditStatus" column="audit_status" />
|
|
<result property="auditDesc" column="audit_desc" />
|
|
|
|
|
|
<result property="rechargeSiteName" column="recharge_site_name" />
|
|
<result property="auditSiteName" column="audit_site_name" />
|
|
<result property="auditManName" column="audit_man_name" />
|
|
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisSitePrepaidRechargeVo">
|
|
select
|
|
a.id, a.recharge_site_code, a.recharge_amount, a.recharge_type,
|
|
a.remittance_type, a.file_path, a.remittance_bank, a.remittance_account_name,
|
|
a.remittance_card_no, a.remittance_date, a.audit_site_code, a.audit_man_code,
|
|
a.audit_date, a.audit_status, a.audit_desc, a.remark, a.tenant_id, a.del_flag, a.create_by,
|
|
a.create_time, a.update_by, a.update_time, a.create_site, a.update_site,
|
|
b.site_name as recharge_site_name,
|
|
c.site_name as audit_site_name,
|
|
d.emp_name as audit_man_name
|
|
from emis_site_prepaid_recharge a
|
|
left join emis_site b on a.recharge_site_code = b.site_code
|
|
left join emis_site c on a.audit_site_code = c.site_code
|
|
left join sys_user d on a.audit_man_code = d.emp_code
|
|
</sql>
|
|
|
|
<select id="selectEmisSitePrepaidRechargeList" parameterType="EmisSitePrepaidRecharge" resultMap="EmisSitePrepaidRechargeResult">
|
|
<include refid="selectEmisSitePrepaidRechargeVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="id != null "> and a.id = #{id}</if>
|
|
<if test="rechargeSiteCode != null and rechargeSiteCode != ''"> and a.recharge_site_code = #{rechargeSiteCode}</if>
|
|
<if test="rechargeAmount != null "> and a.recharge_amount = #{rechargeAmount}</if>
|
|
<if test="rechargeType != null and rechargeType != ''"> and a.recharge_type = #{rechargeType}</if>
|
|
<if test="remittanceType != null and remittanceType != ''"> and a.remittance_type = #{remittanceType}</if>
|
|
<if test="filePath != null and filePath != ''"> and a.file_path like concat('%', #{filePath}, '%')</if>
|
|
<if test="remittanceBank != null and remittanceBank != ''"> and a.remittance_bank like concat('%', #{remittanceBank}, '%')</if>
|
|
<if test="remittanceAccountName != null and remittanceAccountName != ''"> and a.remittance_account_name like concat('%', #{remittanceAccountName}, '%')</if>
|
|
<if test="remittanceCardNo != null and remittanceCardNo != ''"> and a.remittance_card_no like concat('%', #{remittanceCardNo}, '%')</if>
|
|
<if test="remittanceDate != null "> and a.remittance_date = #{remittanceDate}</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''"> and a.audit_site_code = #{auditSiteCode}</if>
|
|
<if test="auditManCode != null and auditManCode != ''"> and a.audit_man_code = #{auditManCode}</if>
|
|
<if test="auditDate != null "> and a.audit_date = #{auditDate}</if>
|
|
<if test="auditStatus != null and auditStatus != ''"> and a.audit_status = #{auditStatus}</if>
|
|
<if test="auditDesc != null and auditDesc != ''"> and a.audit_desc like concat('%', #{auditDesc}, '%')</if>
|
|
<if test="remark != null and remark != ''"> and a.remark like concat('%', #{remark}, '%')</if>
|
|
<if test="tenantId != null and tenantId != ''"> and a.tenant_id like concat('%', #{tenantId}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and a.del_flag=#{delFlag}</if>
|
|
<if test="createBy != null and createBy != ''"> and a.create_by=#{createBy}</if>
|
|
<if test="createTime != null "> and a.create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and a.update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and a.create_site=#{createSite}</if>
|
|
<if test="updateSite != null and updateSite != ''"> and a.update_site like concat('%', #{updateSite}, '%')</if>
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
|
|
and a.create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
|
|
</if>
|
|
<if test="params.endCreateTime != null and params.endCreateTime != ''">
|
|
and a.create_time <![CDATA[ <= ]]> #{params.endCreateTime}
|
|
</if>
|
|
|
|
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
|
and (
|
|
a.recharge_site_code in (
|
|
SELECT t1.site_code FROM (
|
|
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
|
#{params.privSiteCode} ) pd
|
|
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
|
UNION
|
|
SELECT #{params.privSiteCode} FROM dual
|
|
)
|
|
or
|
|
a.create_site = #{params.privSiteCode}
|
|
)
|
|
</if>
|
|
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisSitePrepaidRecharge" resultType="int">
|
|
select count(1) from emis_site_prepaid_recharge
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and recharge_site_code = #{rechargeSiteCode}
|
|
and recharge_amount = #{rechargeAmount}
|
|
and recharge_type = #{rechargeType}
|
|
and remittance_type = #{remittanceType}
|
|
and file_path = #{filePath}
|
|
and remittance_bank = #{remittanceBank}
|
|
and remittance_account_name = #{remittanceAccountName}
|
|
and remittance_card_no = #{remittanceCardNo}
|
|
and remittance_date = #{remittanceDate}
|
|
and audit_site_code = #{auditSiteCode}
|
|
and audit_man_code = #{auditManCode}
|
|
and audit_date = #{auditDate}
|
|
and audit_status = #{auditStatus}
|
|
and audit_desc = #{auditDesc}
|
|
and remark = #{remark}
|
|
and tenant_id = #{tenantId}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisSitePrepaidRechargeById" parameterType="Long" resultMap="EmisSitePrepaidRechargeResult">
|
|
select id, recharge_site_code, recharge_amount, recharge_type, remittance_type, file_path, remittance_bank, remittance_account_name, remittance_card_no, remittance_date, audit_site_code, audit_man_code, audit_date, audit_status, audit_desc, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_site_prepaid_recharge a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisSitePrepaidRecharge" parameterType="EmisSitePrepaidRecharge" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_site_prepaid_recharge
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="rechargeSiteCode != null and rechargeSiteCode != ''">recharge_site_code,</if>
|
|
<if test="rechargeAmount != null">recharge_amount,</if>
|
|
<if test="rechargeType != null and rechargeType != ''">recharge_type,</if>
|
|
<if test="remittanceType != null and remittanceType != ''">remittance_type,</if>
|
|
<if test="filePath != null and filePath != ''">file_path,</if>
|
|
<if test="remittanceBank != null and remittanceBank != ''">remittance_bank,</if>
|
|
<if test="remittanceAccountName != null and remittanceAccountName != ''">remittance_account_name,</if>
|
|
<if test="remittanceCardNo != null and remittanceCardNo != ''">remittance_card_no,</if>
|
|
<if test="remittanceDate != null">remittance_date,</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code,</if>
|
|
<if test="auditManCode != null and auditManCode != ''">audit_man_code,</if>
|
|
<if test="auditDate != null">audit_date,</if>
|
|
<if test="auditStatus != null and auditStatus != ''">audit_status,</if>
|
|
<if test="auditDesc != null and auditDesc != ''">audit_desc,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="rechargeSiteCode != null and rechargeSiteCode != ''">#{rechargeSiteCode},</if>
|
|
<if test="rechargeAmount != null">#{rechargeAmount},</if>
|
|
<if test="rechargeType != null and rechargeType != ''">#{rechargeType},</if>
|
|
<if test="remittanceType != null and remittanceType != ''">#{remittanceType},</if>
|
|
<if test="filePath != null and filePath != ''">#{filePath},</if>
|
|
<if test="remittanceBank != null and remittanceBank != ''">#{remittanceBank},</if>
|
|
<if test="remittanceAccountName != null and remittanceAccountName != ''">#{remittanceAccountName},</if>
|
|
<if test="remittanceCardNo != null and remittanceCardNo != ''">#{remittanceCardNo},</if>
|
|
<if test="remittanceDate != null">#{remittanceDate},</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">#{auditSiteCode},</if>
|
|
<if test="auditManCode != null and auditManCode != ''">#{auditManCode},</if>
|
|
<if test="auditDate != null">#{auditDate},</if>
|
|
<if test="auditStatus != null and auditStatus != ''">#{auditStatus},</if>
|
|
<if test="auditDesc != null and auditDesc != ''">#{auditDesc},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisSitePrepaidRecharge" parameterType="EmisSitePrepaidRecharge">
|
|
update emis_site_prepaid_recharge
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="rechargeSiteCode != null and rechargeSiteCode != ''">recharge_site_code = #{rechargeSiteCode},</if>
|
|
<if test="rechargeAmount != null">recharge_amount = #{rechargeAmount},</if>
|
|
<if test="rechargeType != null and rechargeType != ''">recharge_type = #{rechargeType},</if>
|
|
<if test="remittanceType != null and remittanceType != ''">remittance_type = #{remittanceType},</if>
|
|
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
|
|
<if test="remittanceBank != null and remittanceBank != ''">remittance_bank = #{remittanceBank},</if>
|
|
<if test="remittanceAccountName != null and remittanceAccountName != ''">remittance_account_name = #{remittanceAccountName},</if>
|
|
<if test="remittanceCardNo != null and remittanceCardNo != ''">remittance_card_no = #{remittanceCardNo},</if>
|
|
<if test="remittanceDate != null">remittance_date = #{remittanceDate},</if>
|
|
<if test="auditSiteCode != null and auditSiteCode != ''">audit_site_code = #{auditSiteCode},</if>
|
|
<if test="auditManCode != null and auditManCode != ''">audit_man_code = #{auditManCode},</if>
|
|
<if test="auditDate != null">audit_date = #{auditDate},</if>
|
|
<if test="auditStatus != null and auditStatus != ''">audit_status = #{auditStatus},</if>
|
|
<if test="auditDesc != null and auditDesc != ''">audit_desc = #{auditDesc},</if>
|
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
|
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="auditPass" parameterType="EmisSitePrepaidRecharge">
|
|
update emis_site_prepaid_recharge
|
|
set audit_status='1',audit_date=now() ,
|
|
audit_site_code = #{auditSiteCode},
|
|
audit_man_code = #{auditManCode}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<update id="auditNoPass" parameterType="EmisSitePrepaidRecharge">
|
|
update emis_site_prepaid_recharge
|
|
set audit_status='2',audit_desc = #{auditDesc},audit_date=now() ,
|
|
audit_site_code = #{auditSiteCode},
|
|
audit_man_code = #{auditManCode}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisSitePrepaidRechargeById" parameterType="Long">
|
|
update emis_site_prepaid_recharge set del_flag='1' where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisSitePrepaidRechargeByIds" parameterType="String">
|
|
update emis_site_prepaid_recharge set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |