emis-service/emis-biz/src/main/resources/mapper/EmisSiteAccountMapper.xml

191 lines
14 KiB
XML
Raw Normal View History

2024-03-07 10:49:59 +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.EmisSiteAccountMapper">
<resultMap type="EmisSiteAccount" id="EmisSiteAccountResult">
<result property="id" column="id" />
<result property="accCode" column="acc_code" />
<result property="siteNameCode" column="site_name_code" />
<result property="siteName" column="site_name" />
<result property="centerName" column="center_name" />
<result property="centerNameCode" column="center_name_code" />
<result property="curMoney" column="cur_money" />
<result property="frozenMoney" column="frozen_money" />
<result property="confirmMoney" column="confirm_money" />
<result property="watchMoney" column="watch_money" />
<result property="closeMoney" column="close_money" />
<result property="earnestMoney" column="earnest_money" />
<result property="currency" column="currency" />
<result property="startDate" column="start_date" />
<result property="blOpen" column="bl_open" />
<result property="blLock" column="bl_lock" />
<result property="blClear" column="bl_clear" />
<result property="clearSiteCode" column="clear_site_code" />
<result property="clearDate" column="clear_date" />
<result property="clearManCode" column="clear_man_code" />
<result property="createSiteCode" column="create_site_code" />
<result property="modifySiteCode" column="modify_site_code" />
<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="remark" column="remark" />
</resultMap>
<sql id="selectEmisSiteAccountVo">
select id, acc_code, site_name_code, site_name, center_name, center_name_code, cur_money, frozen_money, confirm_money, watch_money, close_money, earnest_money, currency, start_date, bl_open, bl_lock, bl_clear, clear_site_code, clear_date, clear_man_code, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark from emis_site_account
</sql>
<select id="selectEmisSiteAccountList" parameterType="EmisSiteAccount" resultMap="EmisSiteAccountResult">
<include refid="selectEmisSiteAccountVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="accCode != null and accCode != ''"> and acc_code like concat('%', #{accCode}, '%')</if>
<if test="siteNameCode != null and siteNameCode != ''"> and site_name_code like concat('%', #{siteNameCode}, '%')</if>
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
<if test="centerName != null and centerName != ''"> and center_name like concat('%', #{centerName}, '%')</if>
<if test="centerNameCode != null and centerNameCode != ''"> and center_name_code like concat('%', #{centerNameCode}, '%')</if>
<if test="curMoney != null and curMoney != ''"> and cur_money like concat('%', #{curMoney}, '%')</if>
<if test="frozenMoney != null and frozenMoney != ''"> and frozen_money like concat('%', #{frozenMoney}, '%')</if>
<if test="confirmMoney != null and confirmMoney != ''"> and confirm_money like concat('%', #{confirmMoney}, '%')</if>
<if test="watchMoney != null and watchMoney != ''"> and watch_money like concat('%', #{watchMoney}, '%')</if>
<if test="closeMoney != null and closeMoney != ''"> and close_money like concat('%', #{closeMoney}, '%')</if>
<if test="earnestMoney != null and earnestMoney != ''"> and earnest_money like concat('%', #{earnestMoney}, '%')</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="startDate != null and startDate != ''"> and start_date like concat('%', #{startDate}, '%')</if>
<if test="blOpen != null and blOpen != ''"> and bl_open like concat('%', #{blOpen}, '%')</if>
<if test="blLock != null and blLock != ''"> and bl_lock like concat('%', #{blLock}, '%')</if>
<if test="blClear != null and blClear != ''"> and bl_clear like concat('%', #{blClear}, '%')</if>
<if test="clearSiteCode != null and clearSiteCode != ''"> and clear_site_code like concat('%', #{clearSiteCode}, '%')</if>
<if test="clearDate != null and clearDate != ''"> and clear_date like concat('%', #{clearDate}, '%')</if>
<if test="clearManCode != null and clearManCode != ''"> and clear_man_code like concat('%', #{clearManCode}, '%')</if>
<if test="createSiteCode != null and createSiteCode != ''"> and create_site_code like concat('%', #{createSiteCode}, '%')</if>
<if test="modifySiteCode != null and modifySiteCode != ''"> and modify_site_code like concat('%', #{modifySiteCode}, '%')</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="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisSiteAccountById" parameterType="Long" resultMap="EmisSiteAccountResult">
select id, acc_code, site_name_code, site_name, center_name, center_name_code, cur_money, frozen_money, confirm_money, watch_money, close_money, earnest_money, currency, start_date, bl_open, bl_lock, bl_clear, clear_site_code, clear_date, clear_man_code, create_site_code, modify_site_code, del_flag, create_by, create_time, update_by, update_time, remark
from emis_site_account a
where a.id = #{id}
</select>
<insert id="insertEmisSiteAccount" parameterType="EmisSiteAccount">
insert into emis_site_account
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="accCode != null and accCode != ''">acc_code,</if>
<if test="siteNameCode != null and siteNameCode != ''">site_name_code,</if>
<if test="siteName != null and siteName != ''">site_name,</if>
<if test="centerName != null and centerName != ''">center_name,</if>
<if test="centerNameCode != null and centerNameCode != ''">center_name_code,</if>
<if test="curMoney != null and curMoney != ''">cur_money,</if>
<if test="frozenMoney != null and frozenMoney != ''">frozen_money,</if>
<if test="confirmMoney != null and confirmMoney != ''">confirm_money,</if>
<if test="watchMoney != null and watchMoney != ''">watch_money,</if>
<if test="closeMoney != null and closeMoney != ''">close_money,</if>
<if test="earnestMoney != null and earnestMoney != ''">earnest_money,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="startDate != null and startDate != ''">start_date,</if>
<if test="blOpen != null and blOpen != ''">bl_open,</if>
<if test="blLock != null and blLock != ''">bl_lock,</if>
<if test="blClear != null and blClear != ''">bl_clear,</if>
<if test="clearSiteCode != null and clearSiteCode != ''">clear_site_code,</if>
<if test="clearDate != null and clearDate != ''">clear_date,</if>
<if test="clearManCode != null and clearManCode != ''">clear_man_code,</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code,</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code,</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="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="accCode != null and accCode != ''">#{accCode},</if>
<if test="siteNameCode != null and siteNameCode != ''">#{siteNameCode},</if>
<if test="siteName != null and siteName != ''">#{siteName},</if>
<if test="centerName != null and centerName != ''">#{centerName},</if>
<if test="centerNameCode != null and centerNameCode != ''">#{centerNameCode},</if>
<if test="curMoney != null and curMoney != ''">#{curMoney},</if>
<if test="frozenMoney != null and frozenMoney != ''">#{frozenMoney},</if>
<if test="confirmMoney != null and confirmMoney != ''">#{confirmMoney},</if>
<if test="watchMoney != null and watchMoney != ''">#{watchMoney},</if>
<if test="closeMoney != null and closeMoney != ''">#{closeMoney},</if>
<if test="earnestMoney != null and earnestMoney != ''">#{earnestMoney},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="startDate != null and startDate != ''">#{startDate},</if>
<if test="blOpen != null and blOpen != ''">#{blOpen},</if>
<if test="blLock != null and blLock != ''">#{blLock},</if>
<if test="blClear != null and blClear != ''">#{blClear},</if>
<if test="clearSiteCode != null and clearSiteCode != ''">#{clearSiteCode},</if>
<if test="clearDate != null and clearDate != ''">#{clearDate},</if>
<if test="clearManCode != null and clearManCode != ''">#{clearManCode},</if>
<if test="createSiteCode != null and createSiteCode != ''">#{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">#{modifySiteCode},</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="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateEmisSiteAccount" parameterType="EmisSiteAccount">
update emis_site_account
<trim prefix="SET" suffixOverrides=",">
<if test="accCode != null and accCode != ''">acc_code = #{accCode},</if>
<if test="siteNameCode != null and siteNameCode != ''">site_name_code = #{siteNameCode},</if>
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
<if test="centerName != null and centerName != ''">center_name = #{centerName},</if>
<if test="centerNameCode != null and centerNameCode != ''">center_name_code = #{centerNameCode},</if>
<if test="curMoney != null and curMoney != ''">cur_money = #{curMoney},</if>
<if test="frozenMoney != null and frozenMoney != ''">frozen_money = #{frozenMoney},</if>
<if test="confirmMoney != null and confirmMoney != ''">confirm_money = #{confirmMoney},</if>
<if test="watchMoney != null and watchMoney != ''">watch_money = #{watchMoney},</if>
<if test="closeMoney != null and closeMoney != ''">close_money = #{closeMoney},</if>
<if test="earnestMoney != null and earnestMoney != ''">earnest_money = #{earnestMoney},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="startDate != null and startDate != ''">start_date = #{startDate},</if>
<if test="blOpen != null and blOpen != ''">bl_open = #{blOpen},</if>
<if test="blLock != null and blLock != ''">bl_lock = #{blLock},</if>
<if test="blClear != null and blClear != ''">bl_clear = #{blClear},</if>
<if test="clearSiteCode != null and clearSiteCode != ''">clear_site_code = #{clearSiteCode},</if>
<if test="clearDate != null and clearDate != ''">clear_date = #{clearDate},</if>
<if test="clearManCode != null and clearManCode != ''">clear_man_code = #{clearManCode},</if>
<if test="createSiteCode != null and createSiteCode != ''">create_site_code = #{createSiteCode},</if>
<if test="modifySiteCode != null and modifySiteCode != ''">modify_site_code = #{modifySiteCode},</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="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisSiteAccountById" parameterType="Long">
delete from emis_site_account where id = #{id}
</delete>
<delete id="deleteEmisSiteAccountByIds" parameterType="String">
delete from emis_site_account where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>