2024-04-24 05:36:51 +00:00
<?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.EmisMonthpayAccountMapper" >
<resultMap type= "EmisMonthpayAccount" id= "EmisMonthpayAccountResult" >
<result property= "id" column= "id" />
<result property= "custNo" column= "cust_no" />
<result property= "custName" column= "cust_name" />
<result property= "custNameEn" column= "cust_name_en" />
<result property= "customerCode" column= "customer_code" />
<result property= "userType" column= "user_type" />
<result property= "company" column= "company" />
<result property= "licNo" column= "lic_no" />
<result property= "bizInfo" column= "biz_info" />
<result property= "custLevel" column= "cust_level" />
<result property= "country" column= "country" />
<result property= "province" column= "province" />
<result property= "city" column= "city" />
<result property= "county" column= "county" />
<result property= "address" column= "address" />
<result property= "sex" column= "sex" />
<result property= "ownerSite" column= "owner_site" />
<result property= "contact" column= "contact" />
<result property= "phone" column= "phone" />
<result property= "email" column= "email" />
<result property= "status" column= "status" />
<result property= "payee" column= "payee" />
<result property= "salesmen" column= "salesmen" />
<result property= "marketMan" column= "market_man" />
<result property= "invitationInfo" column= "invitation_info" />
<result property= "contractType" column= "contract_type" />
<result property= "orderNum" column= "order_num" />
<result property= "contractContent" column= "contract_content" />
<result property= "contractChangeContent" column= "contract_change_content" />
<result property= "contractStartdate" column= "contract_startdate" />
<result property= "contractEnddate" column= "contract_enddate" />
<result property= "contractSigndate" column= "contract_signdate" />
<result property= "contractSenddate" column= "contract_senddate" />
<result property= "contractRecievedate" column= "contract_recievedate" />
<result property= "expressName" column= "express_name" />
<result property= "expressBillcode" column= "express_billcode" />
<result property= "bank" column= "bank" />
<result property= "accountNo" column= "account_no" />
<result property= "invoiceAddress" column= "invoice_address" />
<result property= "financialContact" column= "financial_contact" />
<result property= "sender" column= "sender" />
<result property= "sendAddress" column= "send_address" />
<result property= "remark" column= "remark" />
<result property= "delFlag" column= "del_flag" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "createSite" column= "create_site" />
<result property= "updateSite" column= "update_site" />
2024-04-24 06:12:38 +00:00
<association property= "countryName" column= "country" select= "selectCountryNameByCode" />
<association property= "provinceName" column= "province" select= "selectRegionNameByCode" />
<association property= "cityName" column= "city" select= "selectRegionNameByCode" />
<association property= "countyName" column= "county" select= "selectRegionNameByCode" />
<association property= "payeeName" column= "payee" select= "selectEmpNameByCode" />
<association property= "salesmenName" column= "salesmen" select= "selectEmpNameByCode" />
<association property= "marketManName" column= "market_man" select= "selectEmpNameByCode" />
<association property= "ownerSiteName" column= "owner_site" select= "selectSiteNameByCode" />
2024-04-24 05:36:51 +00:00
</resultMap>
2024-04-24 06:12:38 +00:00
2024-04-24 05:36:51 +00:00
<sql id= "selectEmisMonthpayAccountVo" >
select id, cust_no, cust_name, cust_name_en, customer_code, user_type, company, lic_no, biz_info, cust_level, country, province, city, county, address, sex, owner_site, contact, phone, email, status, payee, salesmen, market_man, invitation_info, contract_type, order_num, contract_content, contract_change_content, contract_startdate, contract_enddate, contract_signdate, contract_senddate, contract_recievedate, express_name, express_billcode, bank, account_no, invoice_address, financial_contact, sender, send_address, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_monthpay_account
</sql>
2024-04-24 06:12:38 +00:00
<select id= "selectCountryNameByCode" parameterType= "String" resultType= "string" >
select a.name from emis_country a where a.code = #{code} limit 1
</select>
<select id= "selectRegionNameByCode" parameterType= "String" resultType= "string" >
select a.region_name from emis_region a where a.region_code = #{code} limit 1
</select>
<select id= "selectEmpNameByCode" parameterType= "String" resultType= "string" >
select a.emp_name from sys_user a where a.emp_code = #{code} limit 1
</select>
<select id= "selectSiteNameByCode" parameterType= "String" resultType= "string" >
select a.site_name from emis_site a where a.site_code = #{code} limit 1
</select>
2024-04-24 05:36:51 +00:00
<select id= "selectEmisMonthpayAccountList" parameterType= "EmisMonthpayAccount" resultMap= "EmisMonthpayAccountResult" >
<include refid= "selectEmisMonthpayAccountVo" />
<where >
<if test= "id != null " > and id = #{id}</if>
<if test= "custNo != null and custNo != ''" > and cust_no like concat('%', #{custNo}, '%')</if>
<if test= "custName != null and custName != ''" > and cust_name like concat('%', #{custName}, '%')</if>
<if test= "custNameEn != null and custNameEn != ''" > and cust_name_en like concat('%', #{custNameEn}, '%')</if>
<if test= "customerCode != null and customerCode != ''" > and customer_code like concat('%', #{customerCode}, '%')</if>
<if test= "userType != null and userType != ''" > and user_type like concat('%', #{userType}, '%')</if>
<if test= "company != null and company != ''" > and company like concat('%', #{company}, '%')</if>
<if test= "licNo != null and licNo != ''" > and lic_no like concat('%', #{licNo}, '%')</if>
<if test= "bizInfo != null and bizInfo != ''" > and biz_info like concat('%', #{bizInfo}, '%')</if>
<if test= "custLevel != null and custLevel != ''" > and cust_level like concat('%', #{custLevel}, '%')</if>
<if test= "country != null and country != ''" > and country like concat('%', #{country}, '%')</if>
<if test= "province != null and province != ''" > and province like concat('%', #{province}, '%')</if>
<if test= "city != null and city != ''" > and city like concat('%', #{city}, '%')</if>
<if test= "county != null and county != ''" > and county like concat('%', #{county}, '%')</if>
<if test= "address != null and address != ''" > and address like concat('%', #{address}, '%')</if>
<if test= "sex != null and sex != ''" > and sex like concat('%', #{sex}, '%')</if>
<if test= "ownerSite != null and ownerSite != ''" > and owner_site like concat('%', #{ownerSite}, '%')</if>
<if test= "contact != null and contact != ''" > and contact like concat('%', #{contact}, '%')</if>
<if test= "phone != null and phone != ''" > and phone like concat('%', #{phone}, '%')</if>
<if test= "email != null and email != ''" > and email like concat('%', #{email}, '%')</if>
<if test= "status != null and status != ''" > and status like concat('%', #{status}, '%')</if>
<if test= "payee != null and payee != ''" > and payee like concat('%', #{payee}, '%')</if>
<if test= "salesmen != null and salesmen != ''" > and salesmen like concat('%', #{salesmen}, '%')</if>
<if test= "marketMan != null and marketMan != ''" > and market_man like concat('%', #{marketMan}, '%')</if>
<if test= "invitationInfo != null and invitationInfo != ''" > and invitation_info like concat('%', #{invitationInfo}, '%')</if>
<if test= "contractType != null and contractType != ''" > and contract_type like concat('%', #{contractType}, '%')</if>
<if test= "orderNum != null " > and order_num = #{orderNum}</if>
<if test= "contractContent != null and contractContent != ''" > and contract_content like concat('%', #{contractContent}, '%')</if>
<if test= "contractChangeContent != null and contractChangeContent != ''" > and contract_change_content like concat('%', #{contractChangeContent}, '%')</if>
<if test= "contractStartdate != null " > and contract_startdate = #{contractStartdate}</if>
<if test= "contractEnddate != null " > and contract_enddate = #{contractEnddate}</if>
<if test= "contractSigndate != null " > and contract_signdate = #{contractSigndate}</if>
<if test= "contractSenddate != null " > and contract_senddate = #{contractSenddate}</if>
<if test= "contractRecievedate != null " > and contract_recievedate = #{contractRecievedate}</if>
<if test= "expressName != null and expressName != ''" > and express_name like concat('%', #{expressName}, '%')</if>
<if test= "expressBillcode != null and expressBillcode != ''" > and express_billcode like concat('%', #{expressBillcode}, '%')</if>
<if test= "bank != null and bank != ''" > and bank like concat('%', #{bank}, '%')</if>
<if test= "accountNo != null and accountNo != ''" > and account_no like concat('%', #{accountNo}, '%')</if>
<if test= "invoiceAddress != null and invoiceAddress != ''" > and invoice_address like concat('%', #{invoiceAddress}, '%')</if>
<if test= "financialContact != null and financialContact != ''" > and financial_contact like concat('%', #{financialContact}, '%')</if>
<if test= "sender != null and sender != ''" > and sender like concat('%', #{sender}, '%')</if>
<if test= "sendAddress != null and sendAddress != ''" > and send_address like concat('%', #{sendAddress}, '%')</if>
<if test= "remark != null and remark != ''" > and remark like concat('%', #{remark}, '%')</if>
<if test= "delFlag != null and delFlag != ''" > and del_flag like concat('%', #{delFlag}, '%')</if>
<if test= "createBy != null and createBy != ''" > and create_by like concat('%', #{createBy}, '%')</if>
<if test= "createTime != null " > and create_time = #{createTime}</if>
<if test= "updateBy != null and updateBy != ''" > and update_by like concat('%', #{updateBy}, '%')</if>
<if test= "updateTime != null " > and update_time = #{updateTime}</if>
<if test= "createSite != null and createSite != ''" > and create_site like concat('%', #{createSite}, '%')</if>
<if test= "updateSite != null and updateSite != ''" > and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id= "selectEmisMonthpayAccountById" parameterType= "Long" resultMap= "EmisMonthpayAccountResult" >
select id, cust_no, cust_name, cust_name_en, customer_code, user_type, company, lic_no, biz_info, cust_level, country, province, city, county, address, sex, owner_site, contact, phone, email, status, payee, salesmen, market_man, invitation_info, contract_type, order_num, contract_content, contract_change_content, contract_startdate, contract_enddate, contract_signdate, contract_senddate, contract_recievedate, express_name, express_billcode, bank, account_no, invoice_address, financial_contact, sender, send_address, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_monthpay_account a
where a.id = #{id}
</select>
<insert id= "insertEmisMonthpayAccount" parameterType= "EmisMonthpayAccount" >
insert into emis_monthpay_account
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "id != null" > id,</if>
<if test= "custNo != null and custNo != ''" > cust_no,</if>
<if test= "custName != null and custName != ''" > cust_name,</if>
<if test= "custNameEn != null and custNameEn != ''" > cust_name_en,</if>
<if test= "customerCode != null and customerCode != ''" > customer_code,</if>
<if test= "userType != null and userType != ''" > user_type,</if>
<if test= "company != null and company != ''" > company,</if>
<if test= "licNo != null and licNo != ''" > lic_no,</if>
<if test= "bizInfo != null and bizInfo != ''" > biz_info,</if>
<if test= "custLevel != null and custLevel != ''" > cust_level,</if>
<if test= "country != null and country != ''" > country,</if>
<if test= "province != null and province != ''" > province,</if>
<if test= "city != null and city != ''" > city,</if>
<if test= "county != null and county != ''" > county,</if>
<if test= "address != null and address != ''" > address,</if>
<if test= "sex != null and sex != ''" > sex,</if>
<if test= "ownerSite != null and ownerSite != ''" > owner_site,</if>
<if test= "contact != null and contact != ''" > contact,</if>
<if test= "phone != null and phone != ''" > phone,</if>
<if test= "email != null and email != ''" > email,</if>
<if test= "status != null and status != ''" > status,</if>
<if test= "payee != null and payee != ''" > payee,</if>
<if test= "salesmen != null and salesmen != ''" > salesmen,</if>
<if test= "marketMan != null and marketMan != ''" > market_man,</if>
<if test= "invitationInfo != null and invitationInfo != ''" > invitation_info,</if>
<if test= "contractType != null and contractType != ''" > contract_type,</if>
<if test= "orderNum != null" > order_num,</if>
<if test= "contractContent != null and contractContent != ''" > contract_content,</if>
<if test= "contractChangeContent != null and contractChangeContent != ''" > contract_change_content,</if>
<if test= "contractStartdate != null" > contract_startdate,</if>
<if test= "contractEnddate != null" > contract_enddate,</if>
<if test= "contractSigndate != null" > contract_signdate,</if>
<if test= "contractSenddate != null" > contract_senddate,</if>
<if test= "contractRecievedate != null" > contract_recievedate,</if>
<if test= "expressName != null and expressName != ''" > express_name,</if>
<if test= "expressBillcode != null and expressBillcode != ''" > express_billcode,</if>
<if test= "bank != null and bank != ''" > bank,</if>
<if test= "accountNo != null and accountNo != ''" > account_no,</if>
<if test= "invoiceAddress != null and invoiceAddress != ''" > invoice_address,</if>
<if test= "financialContact != null and financialContact != ''" > financial_contact,</if>
<if test= "sender != null and sender != ''" > sender,</if>
<if test= "sendAddress != null and sendAddress != ''" > send_address,</if>
<if test= "remark != null and remark != ''" > remark,</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= "custNo != null and custNo != ''" > #{custNo},</if>
<if test= "custName != null and custName != ''" > #{custName},</if>
<if test= "custNameEn != null and custNameEn != ''" > #{custNameEn},</if>
<if test= "customerCode != null and customerCode != ''" > #{customerCode},</if>
<if test= "userType != null and userType != ''" > #{userType},</if>
<if test= "company != null and company != ''" > #{company},</if>
<if test= "licNo != null and licNo != ''" > #{licNo},</if>
<if test= "bizInfo != null and bizInfo != ''" > #{bizInfo},</if>
<if test= "custLevel != null and custLevel != ''" > #{custLevel},</if>
<if test= "country != null and country != ''" > #{country},</if>
<if test= "province != null and province != ''" > #{province},</if>
<if test= "city != null and city != ''" > #{city},</if>
<if test= "county != null and county != ''" > #{county},</if>
<if test= "address != null and address != ''" > #{address},</if>
<if test= "sex != null and sex != ''" > #{sex},</if>
<if test= "ownerSite != null and ownerSite != ''" > #{ownerSite},</if>
<if test= "contact != null and contact != ''" > #{contact},</if>
<if test= "phone != null and phone != ''" > #{phone},</if>
<if test= "email != null and email != ''" > #{email},</if>
<if test= "status != null and status != ''" > #{status},</if>
<if test= "payee != null and payee != ''" > #{payee},</if>
<if test= "salesmen != null and salesmen != ''" > #{salesmen},</if>
<if test= "marketMan != null and marketMan != ''" > #{marketMan},</if>
<if test= "invitationInfo != null and invitationInfo != ''" > #{invitationInfo},</if>
<if test= "contractType != null and contractType != ''" > #{contractType},</if>
<if test= "orderNum != null" > #{orderNum},</if>
<if test= "contractContent != null and contractContent != ''" > #{contractContent},</if>
<if test= "contractChangeContent != null and contractChangeContent != ''" > #{contractChangeContent},</if>
<if test= "contractStartdate != null" > #{contractStartdate},</if>
<if test= "contractEnddate != null" > #{contractEnddate},</if>
<if test= "contractSigndate != null" > #{contractSigndate},</if>
<if test= "contractSenddate != null" > #{contractSenddate},</if>
<if test= "contractRecievedate != null" > #{contractRecievedate},</if>
<if test= "expressName != null and expressName != ''" > #{expressName},</if>
<if test= "expressBillcode != null and expressBillcode != ''" > #{expressBillcode},</if>
<if test= "bank != null and bank != ''" > #{bank},</if>
<if test= "accountNo != null and accountNo != ''" > #{accountNo},</if>
<if test= "invoiceAddress != null and invoiceAddress != ''" > #{invoiceAddress},</if>
<if test= "financialContact != null and financialContact != ''" > #{financialContact},</if>
<if test= "sender != null and sender != ''" > #{sender},</if>
<if test= "sendAddress != null and sendAddress != ''" > #{sendAddress},</if>
<if test= "remark != null and remark != ''" > #{remark},</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= "updateEmisMonthpayAccount" parameterType= "EmisMonthpayAccount" >
update emis_monthpay_account
<trim prefix= "SET" suffixOverrides= "," >
<if test= "custNo != null and custNo != ''" > cust_no = #{custNo},</if>
<if test= "custName != null and custName != ''" > cust_name = #{custName},</if>
<if test= "custNameEn != null and custNameEn != ''" > cust_name_en = #{custNameEn},</if>
<if test= "customerCode != null and customerCode != ''" > customer_code = #{customerCode},</if>
<if test= "userType != null and userType != ''" > user_type = #{userType},</if>
<if test= "company != null and company != ''" > company = #{company},</if>
<if test= "licNo != null and licNo != ''" > lic_no = #{licNo},</if>
<if test= "bizInfo != null and bizInfo != ''" > biz_info = #{bizInfo},</if>
<if test= "custLevel != null and custLevel != ''" > cust_level = #{custLevel},</if>
<if test= "country != null and country != ''" > country = #{country},</if>
<if test= "province != null and province != ''" > province = #{province},</if>
<if test= "city != null and city != ''" > city = #{city},</if>
<if test= "county != null and county != ''" > county = #{county},</if>
<if test= "address != null and address != ''" > address = #{address},</if>
<if test= "sex != null and sex != ''" > sex = #{sex},</if>
<if test= "ownerSite != null and ownerSite != ''" > owner_site = #{ownerSite},</if>
<if test= "contact != null and contact != ''" > contact = #{contact},</if>
<if test= "phone != null and phone != ''" > phone = #{phone},</if>
<if test= "email != null and email != ''" > email = #{email},</if>
<if test= "status != null and status != ''" > status = #{status},</if>
<if test= "payee != null and payee != ''" > payee = #{payee},</if>
<if test= "salesmen != null and salesmen != ''" > salesmen = #{salesmen},</if>
<if test= "marketMan != null and marketMan != ''" > market_man = #{marketMan},</if>
<if test= "invitationInfo != null and invitationInfo != ''" > invitation_info = #{invitationInfo},</if>
<if test= "contractType != null and contractType != ''" > contract_type = #{contractType},</if>
<if test= "orderNum != null" > order_num = #{orderNum},</if>
<if test= "contractContent != null and contractContent != ''" > contract_content = #{contractContent},</if>
<if test= "contractChangeContent != null and contractChangeContent != ''" > contract_change_content = #{contractChangeContent},</if>
<if test= "contractStartdate != null" > contract_startdate = #{contractStartdate},</if>
<if test= "contractEnddate != null" > contract_enddate = #{contractEnddate},</if>
<if test= "contractSigndate != null" > contract_signdate = #{contractSigndate},</if>
<if test= "contractSenddate != null" > contract_senddate = #{contractSenddate},</if>
<if test= "contractRecievedate != null" > contract_recievedate = #{contractRecievedate},</if>
<if test= "expressName != null and expressName != ''" > express_name = #{expressName},</if>
<if test= "expressBillcode != null and expressBillcode != ''" > express_billcode = #{expressBillcode},</if>
<if test= "bank != null and bank != ''" > bank = #{bank},</if>
<if test= "accountNo != null and accountNo != ''" > account_no = #{accountNo},</if>
<if test= "invoiceAddress != null and invoiceAddress != ''" > invoice_address = #{invoiceAddress},</if>
<if test= "financialContact != null and financialContact != ''" > financial_contact = #{financialContact},</if>
<if test= "sender != null and sender != ''" > sender = #{sender},</if>
<if test= "sendAddress != null and sendAddress != ''" > send_address = #{sendAddress},</if>
<if test= "remark != null and remark != ''" > remark = #{remark},</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>
<delete id= "deleteEmisMonthpayAccountById" parameterType= "Long" >
delete from emis_monthpay_account where id = #{id}
</delete>
<delete id= "deleteEmisMonthpayAccountByIds" parameterType= "String" >
delete from emis_monthpay_account where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>