优化表结构

This commit is contained in:
季圣华
2020-07-21 23:09:20 +08:00
parent 70f0dae473
commit a4774016c8
53 changed files with 5771 additions and 7185 deletions

View File

@@ -1,383 +1,323 @@
<?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.jsh.erp.datasource.mappers.AccountHeadMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.AccountHead">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="OrganId" jdbcType="BIGINT" property="organid" />
<result column="HandsPersonId" jdbcType="BIGINT" property="handspersonid" />
<result column="ChangeAmount" jdbcType="DECIMAL" property="changeamount" />
<result column="TotalPrice" jdbcType="DECIMAL" property="totalprice" />
<result column="AccountId" jdbcType="BIGINT" property="accountid" />
<result column="BillNo" jdbcType="VARCHAR" property="billno" />
<result column="BillTime" jdbcType="TIMESTAMP" property="billtime" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, Type, OrganId, HandsPersonId, ChangeAmount, TotalPrice, AccountId, BillNo, BillTime,
Remark, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_accounthead
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from jsh_accounthead
where Id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_accounthead
where Id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_accounthead
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountHead">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_accounthead (Id, Type, OrganId,
HandsPersonId, ChangeAmount, TotalPrice,
AccountId, BillNo, BillTime,
Remark, tenant_id, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organid,jdbcType=BIGINT},
#{handspersonid,jdbcType=BIGINT}, #{changeamount,jdbcType=DECIMAL}, #{totalprice,jdbcType=DECIMAL},
#{accountid,jdbcType=BIGINT}, #{billno,jdbcType=VARCHAR}, #{billtime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountHead">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_accounthead
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
</if>
<if test="type != null">
Type,
</if>
<if test="organid != null">
OrganId,
</if>
<if test="handspersonid != null">
HandsPersonId,
</if>
<if test="changeamount != null">
ChangeAmount,
</if>
<if test="totalprice != null">
TotalPrice,
</if>
<if test="accountid != null">
AccountId,
</if>
<if test="billno != null">
BillNo,
</if>
<if test="billtime != null">
BillTime,
</if>
<if test="remark != null">
Remark,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="organid != null">
#{organid,jdbcType=BIGINT},
</if>
<if test="handspersonid != null">
#{handspersonid,jdbcType=BIGINT},
</if>
<if test="changeamount != null">
#{changeamount,jdbcType=DECIMAL},
</if>
<if test="totalprice != null">
#{totalprice,jdbcType=DECIMAL},
</if>
<if test="accountid != null">
#{accountid,jdbcType=BIGINT},
</if>
<if test="billno != null">
#{billno,jdbcType=VARCHAR},
</if>
<if test="billtime != null">
#{billtime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_accounthead
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accounthead
<set>
<if test="record.id != null">
Id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.type != null">
Type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.organid != null">
OrganId = #{record.organid,jdbcType=BIGINT},
</if>
<if test="record.handspersonid != null">
HandsPersonId = #{record.handspersonid,jdbcType=BIGINT},
</if>
<if test="record.changeamount != null">
ChangeAmount = #{record.changeamount,jdbcType=DECIMAL},
</if>
<if test="record.totalprice != null">
TotalPrice = #{record.totalprice,jdbcType=DECIMAL},
</if>
<if test="record.accountid != null">
AccountId = #{record.accountid,jdbcType=BIGINT},
</if>
<if test="record.billno != null">
BillNo = #{record.billno,jdbcType=VARCHAR},
</if>
<if test="record.billtime != null">
BillTime = #{record.billtime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
Remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accounthead
set Id = #{record.id,jdbcType=BIGINT},
Type = #{record.type,jdbcType=VARCHAR},
OrganId = #{record.organid,jdbcType=BIGINT},
HandsPersonId = #{record.handspersonid,jdbcType=BIGINT},
ChangeAmount = #{record.changeamount,jdbcType=DECIMAL},
TotalPrice = #{record.totalprice,jdbcType=DECIMAL},
AccountId = #{record.accountid,jdbcType=BIGINT},
BillNo = #{record.billno,jdbcType=VARCHAR},
BillTime = #{record.billtime,jdbcType=TIMESTAMP},
Remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.AccountHead">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accounthead
<set>
<if test="type != null">
Type = #{type,jdbcType=VARCHAR},
</if>
<if test="organid != null">
OrganId = #{organid,jdbcType=BIGINT},
</if>
<if test="handspersonid != null">
HandsPersonId = #{handspersonid,jdbcType=BIGINT},
</if>
<if test="changeamount != null">
ChangeAmount = #{changeamount,jdbcType=DECIMAL},
</if>
<if test="totalprice != null">
TotalPrice = #{totalprice,jdbcType=DECIMAL},
</if>
<if test="accountid != null">
AccountId = #{accountid,jdbcType=BIGINT},
</if>
<if test="billno != null">
BillNo = #{billno,jdbcType=VARCHAR},
</if>
<if test="billtime != null">
BillTime = #{billtime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.AccountHead">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accounthead
set Type = #{type,jdbcType=VARCHAR},
OrganId = #{organid,jdbcType=BIGINT},
HandsPersonId = #{handspersonid,jdbcType=BIGINT},
ChangeAmount = #{changeamount,jdbcType=DECIMAL},
TotalPrice = #{totalprice,jdbcType=DECIMAL},
AccountId = #{accountid,jdbcType=BIGINT},
BillNo = #{billno,jdbcType=VARCHAR},
BillTime = #{billtime,jdbcType=TIMESTAMP},
Remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
<mapper namespace="com.jsh.erp.datasource.mappers.AccountHeadMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.AccountHead">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="organ_id" jdbcType="BIGINT" property="organId" />
<result column="hands_person_id" jdbcType="BIGINT" property="handsPersonId" />
<result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
<result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
<result column="account_id" jdbcType="BIGINT" property="accountId" />
<result column="bill_no" jdbcType="VARCHAR" property="billNo" />
<result column="bill_time" jdbcType="TIMESTAMP" property="billTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, type, organ_id, hands_person_id, change_amount, total_price, account_id, bill_no,
bill_time, remark, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_account_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_account_head
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_account_head
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample">
delete from jsh_account_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountHead">
insert into jsh_account_head (id, type, organ_id,
hands_person_id, change_amount, total_price,
account_id, bill_no, bill_time,
remark, tenant_id, delete_flag
)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{organId,jdbcType=BIGINT},
#{handsPersonId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL},
#{accountId,jdbcType=BIGINT}, #{billNo,jdbcType=VARCHAR}, #{billTime,jdbcType=TIMESTAMP},
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountHead">
insert into jsh_account_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="type != null">
type,
</if>
<if test="organId != null">
organ_id,
</if>
<if test="handsPersonId != null">
hands_person_id,
</if>
<if test="changeAmount != null">
change_amount,
</if>
<if test="totalPrice != null">
total_price,
</if>
<if test="accountId != null">
account_id,
</if>
<if test="billNo != null">
bill_no,
</if>
<if test="billTime != null">
bill_time,
</if>
<if test="remark != null">
remark,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="organId != null">
#{organId,jdbcType=BIGINT},
</if>
<if test="handsPersonId != null">
#{handsPersonId,jdbcType=BIGINT},
</if>
<if test="changeAmount != null">
#{changeAmount,jdbcType=DECIMAL},
</if>
<if test="totalPrice != null">
#{totalPrice,jdbcType=DECIMAL},
</if>
<if test="accountId != null">
#{accountId,jdbcType=BIGINT},
</if>
<if test="billNo != null">
#{billNo,jdbcType=VARCHAR},
</if>
<if test="billTime != null">
#{billTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultType="java.lang.Long">
select count(*) from jsh_account_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_account_head
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.organId != null">
organ_id = #{record.organId,jdbcType=BIGINT},
</if>
<if test="record.handsPersonId != null">
hands_person_id = #{record.handsPersonId,jdbcType=BIGINT},
</if>
<if test="record.changeAmount != null">
change_amount = #{record.changeAmount,jdbcType=DECIMAL},
</if>
<if test="record.totalPrice != null">
total_price = #{record.totalPrice,jdbcType=DECIMAL},
</if>
<if test="record.accountId != null">
account_id = #{record.accountId,jdbcType=BIGINT},
</if>
<if test="record.billNo != null">
bill_no = #{record.billNo,jdbcType=VARCHAR},
</if>
<if test="record.billTime != null">
bill_time = #{record.billTime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_account_head
set id = #{record.id,jdbcType=BIGINT},
type = #{record.type,jdbcType=VARCHAR},
organ_id = #{record.organId,jdbcType=BIGINT},
hands_person_id = #{record.handsPersonId,jdbcType=BIGINT},
change_amount = #{record.changeAmount,jdbcType=DECIMAL},
total_price = #{record.totalPrice,jdbcType=DECIMAL},
account_id = #{record.accountId,jdbcType=BIGINT},
bill_no = #{record.billNo,jdbcType=VARCHAR},
bill_time = #{record.billTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.AccountHead">
update jsh_account_head
<set>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="organId != null">
organ_id = #{organId,jdbcType=BIGINT},
</if>
<if test="handsPersonId != null">
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
</if>
<if test="changeAmount != null">
change_amount = #{changeAmount,jdbcType=DECIMAL},
</if>
<if test="totalPrice != null">
total_price = #{totalPrice,jdbcType=DECIMAL},
</if>
<if test="accountId != null">
account_id = #{accountId,jdbcType=BIGINT},
</if>
<if test="billNo != null">
bill_no = #{billNo,jdbcType=VARCHAR},
</if>
<if test="billTime != null">
bill_time = #{billTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.AccountHead">
update jsh_account_head
set type = #{type,jdbcType=VARCHAR},
organ_id = #{organId,jdbcType=BIGINT},
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
change_amount = #{changeAmount,jdbcType=DECIMAL},
total_price = #{totalPrice,jdbcType=DECIMAL},
account_id = #{accountId,jdbcType=BIGINT},
bill_no = #{billNo,jdbcType=VARCHAR},
bill_time = #{billTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -3,32 +3,32 @@
<mapper namespace="com.jsh.erp.datasource.mappers.AccountHeadMapperEx">
<resultMap extends="com.jsh.erp.datasource.mappers.AccountHeadMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.AccountHeadVo4ListEx">
<result column="OrganName" jdbcType="VARCHAR" property="organname" />
<result column="HandsPersonName" jdbcType="VARCHAR" property="handspersonname" />
<result column="AccountName" jdbcType="VARCHAR" property="accountname" />
<result column="OrganName" jdbcType="VARCHAR" property="organName" />
<result column="HandsPersonName" jdbcType="VARCHAR" property="handsPersonName" />
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
</resultMap>
<select id="selectByConditionAccountHead" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">
select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName
from jsh_accounthead ah
left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
from jsh_account_head ah
left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.hands_person_id=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if test="billNo != null">
and ah.BillNo like '%${billNo}%'
and ah.bill_no like '%${billNo}%'
</if>
<if test="type != null">
and ah.Type='${type}'
and ah.type='${type}'
</if>
<if test="beginTime != null">
and ah.BillTime &gt;= '${beginTime}'
and ah.bill_time &gt;= '${beginTime}'
</if>
<if test="endTime != null">
and ah.BillTime &lt;= '${endTime}'
and ah.bill_time &lt;= '${endTime}'
</if>
and ifnull(ah.delete_Flag,'0') !='1'
order by ah.Id desc
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -38,49 +38,49 @@
<select id="countsByAccountHead" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_accounthead
FROM jsh_account_head
WHERE 1=1
<if test="billNo != null">
and BillNo like '%${billNo}%'
and bill_no like '%${billNo}%'
</if>
<if test="type != null">
and Type='${type}'
and type='${type}'
</if>
<if test="beginTime != null">
and BillTime &gt;= '${beginTime}'
and bill_time &gt;= '${beginTime}'
</if>
<if test="endTime != null">
and BillTime &lt;= '${endTime}'
and bill_time &lt;= '${endTime}'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getMaxId" resultType="java.lang.Long">
select max(Id) as Id from jsh_accounthead
select max(id) as id from jsh_account_head
</select>
<select id="findAllMoney" resultType="java.math.BigDecimal">
select sum(${modeName}) as allMoney from jsh_accounthead
where Type='${type}'
and OrganId =${supplierId} and BillTime <![CDATA[ <='${endTime}']]>
and ifnull(delete_Flag,'0') !='1'
select sum(${modeName}) as allMoney from jsh_account_head
where type='${type}'
and organ_id =${supplierId} and bill_time <![CDATA[ <='${endTime}']]>
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">
select ah.*, s.supplier OrganName, p.Name HandsPersonName, a.Name AccountName
from jsh_accounthead ah
left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
from jsh_account_head ah
left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on ah.hands_person_id=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on ah.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if test="billNo != null">
and ah.BillNo = '${billNo}'
and ah.bill_no = '${billNo}'
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
</select>
<update id="batchDeleteAccountHeadByIds">
update jsh_accounthead
set delete_Flag='1'
update jsh_account_head
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
@@ -91,37 +91,37 @@
<select id="getAccountHeadListByAccountIds" resultMap="com.jsh.erp.datasource.mappers.AccountHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountHeadMapper.Base_Column_List" />
from jsh_accounthead
from jsh_account_head
where 1=1
and accountId in (
and account_id in (
<foreach collection="accountIds" item="accountId" separator=",">
#{accountId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getAccountHeadListByOrganIds" resultMap="com.jsh.erp.datasource.mappers.AccountHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountHeadMapper.Base_Column_List" />
from jsh_accounthead
from jsh_account_head
where 1=1
and organId in (
and organ_id in (
<foreach collection="organIds" item="organId" separator=",">
#{organId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getAccountHeadListByHandsPersonIds" resultMap="com.jsh.erp.datasource.mappers.AccountHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountHeadMapper.Base_Column_List" />
from jsh_accounthead
from jsh_account_head
where 1=1
and handsPersonId in (
and hands_person_id in (
<foreach collection="handsPersonIds" item="handsPersonId" separator=",">
#{handsPersonId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
</mapper>

View File

@@ -1,318 +1,258 @@
<?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.jsh.erp.datasource.mappers.AccountItemMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.AccountItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="HeaderId" jdbcType="BIGINT" property="headerid" />
<result column="AccountId" jdbcType="BIGINT" property="accountid" />
<result column="InOutItemId" jdbcType="BIGINT" property="inoutitemid" />
<result column="EachAmount" jdbcType="DECIMAL" property="eachamount" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, HeaderId, AccountId, InOutItemId, EachAmount, Remark, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_accountitem
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from jsh_accountitem
where Id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_accountitem
where Id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_accountitem
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_accountitem (Id, HeaderId, AccountId,
InOutItemId, EachAmount, Remark,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{headerid,jdbcType=BIGINT}, #{accountid,jdbcType=BIGINT},
#{inoutitemid,jdbcType=BIGINT}, #{eachamount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_accountitem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
</if>
<if test="headerid != null">
HeaderId,
</if>
<if test="accountid != null">
AccountId,
</if>
<if test="inoutitemid != null">
InOutItemId,
</if>
<if test="eachamount != null">
EachAmount,
</if>
<if test="remark != null">
Remark,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="headerid != null">
#{headerid,jdbcType=BIGINT},
</if>
<if test="accountid != null">
#{accountid,jdbcType=BIGINT},
</if>
<if test="inoutitemid != null">
#{inoutitemid,jdbcType=BIGINT},
</if>
<if test="eachamount != null">
#{eachamount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_accountitem
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accountitem
<set>
<if test="record.id != null">
Id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.headerid != null">
HeaderId = #{record.headerid,jdbcType=BIGINT},
</if>
<if test="record.accountid != null">
AccountId = #{record.accountid,jdbcType=BIGINT},
</if>
<if test="record.inoutitemid != null">
InOutItemId = #{record.inoutitemid,jdbcType=BIGINT},
</if>
<if test="record.eachamount != null">
EachAmount = #{record.eachamount,jdbcType=DECIMAL},
</if>
<if test="record.remark != null">
Remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accountitem
set Id = #{record.id,jdbcType=BIGINT},
HeaderId = #{record.headerid,jdbcType=BIGINT},
AccountId = #{record.accountid,jdbcType=BIGINT},
InOutItemId = #{record.inoutitemid,jdbcType=BIGINT},
EachAmount = #{record.eachamount,jdbcType=DECIMAL},
Remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accountitem
<set>
<if test="headerid != null">
HeaderId = #{headerid,jdbcType=BIGINT},
</if>
<if test="accountid != null">
AccountId = #{accountid,jdbcType=BIGINT},
</if>
<if test="inoutitemid != null">
InOutItemId = #{inoutitemid,jdbcType=BIGINT},
</if>
<if test="eachamount != null">
EachAmount = #{eachamount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.AccountItem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_accountitem
set HeaderId = #{headerid,jdbcType=BIGINT},
AccountId = #{accountid,jdbcType=BIGINT},
InOutItemId = #{inoutitemid,jdbcType=BIGINT},
EachAmount = #{eachamount,jdbcType=DECIMAL},
Remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
<mapper namespace="com.jsh.erp.datasource.mappers.AccountItemMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.AccountItem">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="header_id" jdbcType="BIGINT" property="headerId" />
<result column="account_id" jdbcType="BIGINT" property="accountId" />
<result column="in_out_item_id" jdbcType="BIGINT" property="inOutItemId" />
<result column="each_amount" jdbcType="DECIMAL" property="eachAmount" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, header_id, account_id, in_out_item_id, each_amount, remark, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_account_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_account_item
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_account_item
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample">
delete from jsh_account_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.AccountItem">
insert into jsh_account_item (id, header_id, account_id,
in_out_item_id, each_amount, remark,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT},
#{inOutItemId,jdbcType=BIGINT}, #{eachAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
insert into jsh_account_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="headerId != null">
header_id,
</if>
<if test="accountId != null">
account_id,
</if>
<if test="inOutItemId != null">
in_out_item_id,
</if>
<if test="eachAmount != null">
each_amount,
</if>
<if test="remark != null">
remark,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="headerId != null">
#{headerId,jdbcType=BIGINT},
</if>
<if test="accountId != null">
#{accountId,jdbcType=BIGINT},
</if>
<if test="inOutItemId != null">
#{inOutItemId,jdbcType=BIGINT},
</if>
<if test="eachAmount != null">
#{eachAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultType="java.lang.Long">
select count(*) from jsh_account_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_account_item
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.headerId != null">
header_id = #{record.headerId,jdbcType=BIGINT},
</if>
<if test="record.accountId != null">
account_id = #{record.accountId,jdbcType=BIGINT},
</if>
<if test="record.inOutItemId != null">
in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT},
</if>
<if test="record.eachAmount != null">
each_amount = #{record.eachAmount,jdbcType=DECIMAL},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_account_item
set id = #{record.id,jdbcType=BIGINT},
header_id = #{record.headerId,jdbcType=BIGINT},
account_id = #{record.accountId,jdbcType=BIGINT},
in_out_item_id = #{record.inOutItemId,jdbcType=BIGINT},
each_amount = #{record.eachAmount,jdbcType=DECIMAL},
remark = #{record.remark,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.AccountItem">
update jsh_account_item
<set>
<if test="headerId != null">
header_id = #{headerId,jdbcType=BIGINT},
</if>
<if test="accountId != null">
account_id = #{accountId,jdbcType=BIGINT},
</if>
<if test="inOutItemId != null">
in_out_item_id = #{inOutItemId,jdbcType=BIGINT},
</if>
<if test="eachAmount != null">
each_amount = #{eachAmount,jdbcType=DECIMAL},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.AccountItem">
update jsh_account_item
set header_id = #{headerId,jdbcType=BIGINT},
account_id = #{accountId,jdbcType=BIGINT},
in_out_item_id = #{inOutItemId,jdbcType=BIGINT},
each_amount = #{eachAmount,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -9,7 +9,7 @@
<select id="selectByConditionAccountItem" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
select *
FROM jsh_accountitem
FROM jsh_account_item
where 1=1
<if test="name != null">
and name like '%${name}%'
@@ -20,7 +20,7 @@
<if test="remark != null">
and remark like '%${remark}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -28,7 +28,7 @@
<select id="countsByAccountItem" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_accountitem
FROM jsh_account_item
WHERE 1=1
<if test="name != null">
and name like '%${name}%'
@@ -39,20 +39,20 @@
<if test="remark != null">
and remark like '%${remark}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="ResultWithInfoExMap">
select ai.*,a.Name AccountName,ioi.Name InOutItemName
from jsh_accountitem ai left join jsh_account a on ai.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_inoutitem ioi on ai.InOutItemId = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.HeaderId = ${headerId}
and ifnull(ai.delete_Flag,'0') !='1'
from jsh_account_item ai left join jsh_account a on ai.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_in_out_item ioi on ai.in_out_item_id = ioi.id and ifnull(ioi.delete_Flag,'0') !='1'
where ai.header_id = ${headerId}
and ifnull(ai.delete_flag,'0') !='1'
order by ai.id asc
</select>
<update id="batchDeleteAccountItemByIds">
update jsh_accountitem
set delete_Flag='1'
update jsh_account_item
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
@@ -63,37 +63,37 @@
<select id="getAccountItemListByAccountIds" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountItemMapper.Base_Column_List" />
from jsh_accountitem
from jsh_account_item
where 1=1
and accountId in (
and account_id in (
<foreach collection="accountIds" item="accountId" separator=",">
#{accountId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getAccountItemListByHeaderIds" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountItemMapper.Base_Column_List" />
from jsh_accountitem
from jsh_account_item
where 1=1
and headerId in (
and header_id in (
<foreach collection="headerIds" item="headerId" separator=",">
#{headerId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getAccountItemListByInOutItemIds" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.AccountItemMapper.Base_Column_List" />
from jsh_accountitem
from jsh_account_item
where 1=1
and inOutItemId in (
and in_out_item_id in (
<foreach collection="inOutItemIds" item="inOutItemId" separator=",">
#{inOutItemId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
</mapper>

View File

@@ -9,7 +9,7 @@
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="newType" jdbcType="VARCHAR" property="type" />
<result column="supplier" jdbcType="VARCHAR" property="supplierName" />
<result column="ChangeAmount" jdbcType="DECIMAL" property="changeAmount" />
<result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
<result column="oTime" jdbcType="VARCHAR" property="operTime" />
<result column="AList" jdbcType="VARCHAR" property="aList" />
<result column="AMList" jdbcType="VARCHAR" property="amList" />
@@ -53,61 +53,61 @@
<select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList">
<!--主表出入库涉及的账户 -->
select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_depothead dh left join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
select dh.number,concat(dh.sub_type,dh.type) as newType,s.supplier,dh.change_amount,date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and dh.AccountId=${accountId}
and dh.account_id=${accountId}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
<!--主表收入和支出涉及的账户 -->
UNION ALL
select ah.BillNo,ah.Type as newType,s.supplier,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
select ah.bill_no,ah.type as newType,s.supplier,ah.change_amount,date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and ah.AccountId=${accountId}
and ah.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) -->
UNION ALL
select ah.BillNo,ah.Type as newType,s.supplier,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah left join jsh_supplier s on ah.OrganId=s.id
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款')
select ah.bill_no,ah.type as newType,s.supplier,ai.each_amount,date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id
inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type in ('收款','付款','收预付款')
<if test="accountId != null">
and ai.AccountId=${accountId}
and ai.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--主表中转出的账户 -->
UNION ALL
select ah.BillNo,ah.Type as newType, '' as sName,ah.ChangeAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账'
select ah.bill_no,ah.type as newType, '' as sName,ah.change_amount,date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if test="accountId != null">
and ah.AccountId=${accountId}
and ah.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中被转入的账户 -->
UNION ALL
select ah.BillNo,ah.Type as newType, '' as sName,ai.EachAmount,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账'
select ah.bill_no,ah.type as newType, '' as sName,ai.each_amount,date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime,'' as AList,'' as AMList
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if test="accountId != null">
and ai.AccountId=${accountId}
and ai.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--多账户的情况 -->
UNION ALL
select dh.Number,concat(dh.SubType,dh.Type) as newType,s.supplier,dh.ChangeAmount,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,
dh.AccountIdList as AList,dh.AccountMoneyList as AMList
from jsh_depothead dh left join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
select dh.number,concat(dh.sub_type,dh.type) as newType,s.supplier,dh.change_amount,date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime,
dh.account_id_list as AList,dh.account_money_list as AMList
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and dh.AccountIdList like '%${accountId}%'
and dh.account_id_list like '%${accountId}%'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oTime desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -119,58 +119,58 @@
(
<!--主表出入库涉及的账户 -->
select count(1) a
from jsh_depothead dh left join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and dh.AccountId=${accountId}
and dh.account_id=${accountId}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
<!--主表收入和支出涉及的账户 -->
UNION ALL
select count(1) a
from jsh_accounthead ah left join jsh_supplier s on ah.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and ah.AccountId=${accountId}
and ah.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中涉及的账户(收款,付款,收预付款) -->
UNION ALL
select count(1) a
from jsh_accounthead ah left join jsh_supplier s on ah.OrganId=s.id
inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
from jsh_account_head ah left join jsh_supplier s on ah.organ_id=s.id
inner join jsh_account_item ai on ai.header_id=ah.Id and ifnull(ai.delete_flag,'0') !='1'
where ah.Type in ('收款','付款','收预付款')
<if test="accountId != null">
and ai.AccountId=${accountId}
and ai.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--主表中转出的账户 -->
UNION ALL
select count(1) a
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账'
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if test="accountId != null">
and ah.AccountId=${accountId}
and ah.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--明细中被转入的账户 -->
UNION ALL
select count(1) a
from jsh_accounthead ah inner join jsh_accountitem ai on ai.HeaderId=ah.Id and ifnull(ai.delete_Flag,'0') !='1'
where ah.Type='转账'
from jsh_account_head ah inner join jsh_account_item ai on ai.header_id=ah.id and ifnull(ai.delete_flag,'0') !='1'
where ah.type='转账'
<if test="accountId != null">
and ai.AccountId=${accountId}
and ai.account_id=${accountId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
<!--多账户的情况 -->
UNION ALL
select count(1) a
from jsh_depothead dh left join jsh_supplier s on dh.OrganId = s.id and ifnull(s.delete_Flag,'0') !='1'
from jsh_depot_head dh left join jsh_supplier s on dh.organ_id = s.id and ifnull(s.delete_flag,'0') !='1'
where 1=1
<if test="accountId != null">
and dh.AccountIdList like '%${accountId}%'
and dh.account_id_list like '%${accountId}%'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
) cc
</select>
<update id="batchDeleteAccountByIds">

View File

@@ -2,35 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.DepotHeadMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotHead">
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="SubType" jdbcType="VARCHAR" property="subtype" />
<result column="DefaultNumber" jdbcType="VARCHAR" property="defaultnumber" />
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="OperPersonName" jdbcType="VARCHAR" property="operpersonname" />
<result column="CreateTime" jdbcType="TIMESTAMP" property="createtime" />
<result column="OperTime" jdbcType="TIMESTAMP" property="opertime" />
<result column="OrganId" jdbcType="BIGINT" property="organid" />
<result column="HandsPersonId" jdbcType="BIGINT" property="handspersonid" />
<result column="AccountId" jdbcType="BIGINT" property="accountid" />
<result column="ChangeAmount" jdbcType="DECIMAL" property="changeamount" />
<result column="TotalPrice" jdbcType="DECIMAL" property="totalprice" />
<result column="PayType" jdbcType="VARCHAR" property="paytype" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="Salesman" jdbcType="VARCHAR" property="salesman" />
<result column="AccountIdList" jdbcType="VARCHAR" property="accountidlist" />
<result column="AccountMoneyList" jdbcType="VARCHAR" property="accountmoneylist" />
<result column="Discount" jdbcType="DECIMAL" property="discount" />
<result column="DiscountMoney" jdbcType="DECIMAL" property="discountmoney" />
<result column="DiscountLastMoney" jdbcType="DECIMAL" property="discountlastmoney" />
<result column="OtherMoney" jdbcType="DECIMAL" property="othermoney" />
<result column="OtherMoneyList" jdbcType="VARCHAR" property="othermoneylist" />
<result column="OtherMoneyItem" jdbcType="VARCHAR" property="othermoneyitem" />
<result column="AccountDay" jdbcType="INTEGER" property="accountday" />
<result column="Status" jdbcType="VARCHAR" property="status" />
<result column="LinkNumber" jdbcType="VARCHAR" property="linknumber" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
<result column="default_number" jdbcType="VARCHAR" property="defaultNumber" />
<result column="number" jdbcType="VARCHAR" property="number" />
<result column="oper_person_name" jdbcType="VARCHAR" property="operPersonName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="oper_time" jdbcType="TIMESTAMP" property="operTime" />
<result column="organ_id" jdbcType="BIGINT" property="organId" />
<result column="hands_person_id" jdbcType="BIGINT" property="handsPersonId" />
<result column="account_id" jdbcType="BIGINT" property="accountId" />
<result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
<result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
<result column="pay_type" jdbcType="VARCHAR" property="payType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sales_man" jdbcType="VARCHAR" property="salesMan" />
<result column="account_id_list" jdbcType="VARCHAR" property="accountIdList" />
<result column="account_money_list" jdbcType="VARCHAR" property="accountMoneyList" />
<result column="discount" jdbcType="DECIMAL" property="discount" />
<result column="discount_money" jdbcType="DECIMAL" property="discountMoney" />
<result column="discount_last_money" jdbcType="DECIMAL" property="discountLastMoney" />
<result column="other_money" jdbcType="DECIMAL" property="otherMoney" />
<result column="other_money_list" jdbcType="VARCHAR" property="otherMoneyList" />
<result column="other_money_item" jdbcType="VARCHAR" property="otherMoneyItem" />
<result column="account_day" jdbcType="INTEGER" property="accountDay" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="link_number" jdbcType="VARCHAR" property="linkNumber" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -91,10 +91,11 @@
</where>
</sql>
<sql id="Base_Column_List">
Id, Type, SubType, DefaultNumber, Number, OperPersonName, CreateTime, OperTime, OrganId,
HandsPersonId, AccountId, ChangeAmount, TotalPrice, PayType, Remark, Salesman, AccountIdList,
AccountMoneyList, Discount, DiscountMoney, DiscountLastMoney, OtherMoney, OtherMoneyList,
OtherMoneyItem, AccountDay, Status, LinkNumber, tenant_id, delete_Flag
id, type, sub_type, default_number, number, oper_person_name, create_time, oper_time,
organ_id, hands_person_id, account_id, change_amount, total_price, pay_type, remark,
sales_man, account_id_list, account_money_list, discount, discount_money, discount_last_money,
other_money, other_money_list, other_money_item, account_day, status, link_number,
tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="BaseResultMap">
select
@@ -102,7 +103,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from jsh_depothead
from jsh_depot_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@@ -113,130 +114,130 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_depothead
where Id = #{id,jdbcType=BIGINT}
from jsh_depot_head
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_depothead
where Id = #{id,jdbcType=BIGINT}
delete from jsh_depot_head
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample">
delete from jsh_depothead
delete from jsh_depot_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotHead">
insert into jsh_depothead (Id, Type, SubType,
DefaultNumber, Number, OperPersonName,
CreateTime, OperTime, OrganId,
HandsPersonId, AccountId, ChangeAmount,
TotalPrice, PayType, Remark,
Salesman, AccountIdList, AccountMoneyList,
Discount, DiscountMoney, DiscountLastMoney,
OtherMoney, OtherMoneyList, OtherMoneyItem,
AccountDay, Status, LinkNumber,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subtype,jdbcType=VARCHAR},
#{defaultnumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{operpersonname,jdbcType=VARCHAR},
#{createtime,jdbcType=TIMESTAMP}, #{opertime,jdbcType=TIMESTAMP}, #{organid,jdbcType=BIGINT},
#{handspersonid,jdbcType=BIGINT}, #{accountid,jdbcType=BIGINT}, #{changeamount,jdbcType=DECIMAL},
#{totalprice,jdbcType=DECIMAL}, #{paytype,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{salesman,jdbcType=VARCHAR}, #{accountidlist,jdbcType=VARCHAR}, #{accountmoneylist,jdbcType=VARCHAR},
#{discount,jdbcType=DECIMAL}, #{discountmoney,jdbcType=DECIMAL}, #{discountlastmoney,jdbcType=DECIMAL},
#{othermoney,jdbcType=DECIMAL}, #{othermoneylist,jdbcType=VARCHAR}, #{othermoneyitem,jdbcType=VARCHAR},
#{accountday,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{linknumber,jdbcType=VARCHAR},
insert into jsh_depot_head (id, type, sub_type,
default_number, number, oper_person_name,
create_time, oper_time, organ_id,
hands_person_id, account_id, change_amount,
total_price, pay_type, remark,
sales_man, account_id_list, account_money_list,
discount, discount_money, discount_last_money,
other_money, other_money_list, other_money_item,
account_day, status, link_number,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subType,jdbcType=VARCHAR},
#{defaultNumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{operPersonName,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT},
#{handsPersonId,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL},
#{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{salesMan,jdbcType=VARCHAR}, #{accountIdList,jdbcType=VARCHAR}, #{accountMoneyList,jdbcType=VARCHAR},
#{discount,jdbcType=DECIMAL}, #{discountMoney,jdbcType=DECIMAL}, #{discountLastMoney,jdbcType=DECIMAL},
#{otherMoney,jdbcType=DECIMAL}, #{otherMoneyList,jdbcType=VARCHAR}, #{otherMoneyItem,jdbcType=VARCHAR},
#{accountDay,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR}, #{linkNumber,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
insert into jsh_depothead
insert into jsh_depot_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
id,
</if>
<if test="type != null">
Type,
type,
</if>
<if test="subtype != null">
SubType,
<if test="subType != null">
sub_type,
</if>
<if test="defaultnumber != null">
DefaultNumber,
<if test="defaultNumber != null">
default_number,
</if>
<if test="number != null">
Number,
number,
</if>
<if test="operpersonname != null">
OperPersonName,
<if test="operPersonName != null">
oper_person_name,
</if>
<if test="createtime != null">
CreateTime,
<if test="createTime != null">
create_time,
</if>
<if test="opertime != null">
OperTime,
<if test="operTime != null">
oper_time,
</if>
<if test="organid != null">
OrganId,
<if test="organId != null">
organ_id,
</if>
<if test="handspersonid != null">
HandsPersonId,
<if test="handsPersonId != null">
hands_person_id,
</if>
<if test="accountid != null">
AccountId,
<if test="accountId != null">
account_id,
</if>
<if test="changeamount != null">
ChangeAmount,
<if test="changeAmount != null">
change_amount,
</if>
<if test="totalprice != null">
TotalPrice,
<if test="totalPrice != null">
total_price,
</if>
<if test="paytype != null">
PayType,
<if test="payType != null">
pay_type,
</if>
<if test="remark != null">
Remark,
remark,
</if>
<if test="salesman != null">
Salesman,
<if test="salesMan != null">
sales_man,
</if>
<if test="accountidlist != null">
AccountIdList,
<if test="accountIdList != null">
account_id_list,
</if>
<if test="accountmoneylist != null">
AccountMoneyList,
<if test="accountMoneyList != null">
account_money_list,
</if>
<if test="discount != null">
Discount,
discount,
</if>
<if test="discountmoney != null">
DiscountMoney,
<if test="discountMoney != null">
discount_money,
</if>
<if test="discountlastmoney != null">
DiscountLastMoney,
<if test="discountLastMoney != null">
discount_last_money,
</if>
<if test="othermoney != null">
OtherMoney,
<if test="otherMoney != null">
other_money,
</if>
<if test="othermoneylist != null">
OtherMoneyList,
<if test="otherMoneyList != null">
other_money_list,
</if>
<if test="othermoneyitem != null">
OtherMoneyItem,
<if test="otherMoneyItem != null">
other_money_item,
</if>
<if test="accountday != null">
AccountDay,
<if test="accountDay != null">
account_day,
</if>
<if test="status != null">
Status,
status,
</if>
<if test="linknumber != null">
LinkNumber,
<if test="linkNumber != null">
link_number,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -246,80 +247,80 @@
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="subtype != null">
#{subtype,jdbcType=VARCHAR},
<if test="subType != null">
#{subType,jdbcType=VARCHAR},
</if>
<if test="defaultnumber != null">
#{defaultnumber,jdbcType=VARCHAR},
<if test="defaultNumber != null">
#{defaultNumber,jdbcType=VARCHAR},
</if>
<if test="number != null">
#{number,jdbcType=VARCHAR},
</if>
<if test="operpersonname != null">
#{operpersonname,jdbcType=VARCHAR},
<if test="operPersonName != null">
#{operPersonName,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="opertime != null">
#{opertime,jdbcType=TIMESTAMP},
<if test="operTime != null">
#{operTime,jdbcType=TIMESTAMP},
</if>
<if test="organid != null">
#{organid,jdbcType=BIGINT},
<if test="organId != null">
#{organId,jdbcType=BIGINT},
</if>
<if test="handspersonid != null">
#{handspersonid,jdbcType=BIGINT},
<if test="handsPersonId != null">
#{handsPersonId,jdbcType=BIGINT},
</if>
<if test="accountid != null">
#{accountid,jdbcType=BIGINT},
<if test="accountId != null">
#{accountId,jdbcType=BIGINT},
</if>
<if test="changeamount != null">
#{changeamount,jdbcType=DECIMAL},
<if test="changeAmount != null">
#{changeAmount,jdbcType=DECIMAL},
</if>
<if test="totalprice != null">
#{totalprice,jdbcType=DECIMAL},
<if test="totalPrice != null">
#{totalPrice,jdbcType=DECIMAL},
</if>
<if test="paytype != null">
#{paytype,jdbcType=VARCHAR},
<if test="payType != null">
#{payType,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="salesman != null">
#{salesman,jdbcType=VARCHAR},
<if test="salesMan != null">
#{salesMan,jdbcType=VARCHAR},
</if>
<if test="accountidlist != null">
#{accountidlist,jdbcType=VARCHAR},
<if test="accountIdList != null">
#{accountIdList,jdbcType=VARCHAR},
</if>
<if test="accountmoneylist != null">
#{accountmoneylist,jdbcType=VARCHAR},
<if test="accountMoneyList != null">
#{accountMoneyList,jdbcType=VARCHAR},
</if>
<if test="discount != null">
#{discount,jdbcType=DECIMAL},
</if>
<if test="discountmoney != null">
#{discountmoney,jdbcType=DECIMAL},
<if test="discountMoney != null">
#{discountMoney,jdbcType=DECIMAL},
</if>
<if test="discountlastmoney != null">
#{discountlastmoney,jdbcType=DECIMAL},
<if test="discountLastMoney != null">
#{discountLastMoney,jdbcType=DECIMAL},
</if>
<if test="othermoney != null">
#{othermoney,jdbcType=DECIMAL},
<if test="otherMoney != null">
#{otherMoney,jdbcType=DECIMAL},
</if>
<if test="othermoneylist != null">
#{othermoneylist,jdbcType=VARCHAR},
<if test="otherMoneyList != null">
#{otherMoneyList,jdbcType=VARCHAR},
</if>
<if test="othermoneyitem != null">
#{othermoneyitem,jdbcType=VARCHAR},
<if test="otherMoneyItem != null">
#{otherMoneyItem,jdbcType=VARCHAR},
</if>
<if test="accountday != null">
#{accountday,jdbcType=INTEGER},
<if test="accountDay != null">
#{accountDay,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="linknumber != null">
#{linknumber,jdbcType=VARCHAR},
<if test="linkNumber != null">
#{linkNumber,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
@@ -330,100 +331,100 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Long">
select count(*) from jsh_depothead
select count(*) from jsh_depot_head
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_depothead
update jsh_depot_head
<set>
<if test="record.id != null">
Id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.type != null">
Type = #{record.type,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.subtype != null">
SubType = #{record.subtype,jdbcType=VARCHAR},
<if test="record.subType != null">
sub_type = #{record.subType,jdbcType=VARCHAR},
</if>
<if test="record.defaultnumber != null">
DefaultNumber = #{record.defaultnumber,jdbcType=VARCHAR},
<if test="record.defaultNumber != null">
default_number = #{record.defaultNumber,jdbcType=VARCHAR},
</if>
<if test="record.number != null">
Number = #{record.number,jdbcType=VARCHAR},
number = #{record.number,jdbcType=VARCHAR},
</if>
<if test="record.operpersonname != null">
OperPersonName = #{record.operpersonname,jdbcType=VARCHAR},
<if test="record.operPersonName != null">
oper_person_name = #{record.operPersonName,jdbcType=VARCHAR},
</if>
<if test="record.createtime != null">
CreateTime = #{record.createtime,jdbcType=TIMESTAMP},
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.opertime != null">
OperTime = #{record.opertime,jdbcType=TIMESTAMP},
<if test="record.operTime != null">
oper_time = #{record.operTime,jdbcType=TIMESTAMP},
</if>
<if test="record.organid != null">
OrganId = #{record.organid,jdbcType=BIGINT},
<if test="record.organId != null">
organ_id = #{record.organId,jdbcType=BIGINT},
</if>
<if test="record.handspersonid != null">
HandsPersonId = #{record.handspersonid,jdbcType=BIGINT},
<if test="record.handsPersonId != null">
hands_person_id = #{record.handsPersonId,jdbcType=BIGINT},
</if>
<if test="record.accountid != null">
AccountId = #{record.accountid,jdbcType=BIGINT},
<if test="record.accountId != null">
account_id = #{record.accountId,jdbcType=BIGINT},
</if>
<if test="record.changeamount != null">
ChangeAmount = #{record.changeamount,jdbcType=DECIMAL},
<if test="record.changeAmount != null">
change_amount = #{record.changeAmount,jdbcType=DECIMAL},
</if>
<if test="record.totalprice != null">
TotalPrice = #{record.totalprice,jdbcType=DECIMAL},
<if test="record.totalPrice != null">
total_price = #{record.totalPrice,jdbcType=DECIMAL},
</if>
<if test="record.paytype != null">
PayType = #{record.paytype,jdbcType=VARCHAR},
<if test="record.payType != null">
pay_type = #{record.payType,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
Remark = #{record.remark,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.salesman != null">
Salesman = #{record.salesman,jdbcType=VARCHAR},
<if test="record.salesMan != null">
sales_man = #{record.salesMan,jdbcType=VARCHAR},
</if>
<if test="record.accountidlist != null">
AccountIdList = #{record.accountidlist,jdbcType=VARCHAR},
<if test="record.accountIdList != null">
account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
</if>
<if test="record.accountmoneylist != null">
AccountMoneyList = #{record.accountmoneylist,jdbcType=VARCHAR},
<if test="record.accountMoneyList != null">
account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
</if>
<if test="record.discount != null">
Discount = #{record.discount,jdbcType=DECIMAL},
discount = #{record.discount,jdbcType=DECIMAL},
</if>
<if test="record.discountmoney != null">
DiscountMoney = #{record.discountmoney,jdbcType=DECIMAL},
<if test="record.discountMoney != null">
discount_money = #{record.discountMoney,jdbcType=DECIMAL},
</if>
<if test="record.discountlastmoney != null">
DiscountLastMoney = #{record.discountlastmoney,jdbcType=DECIMAL},
<if test="record.discountLastMoney != null">
discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
</if>
<if test="record.othermoney != null">
OtherMoney = #{record.othermoney,jdbcType=DECIMAL},
<if test="record.otherMoney != null">
other_money = #{record.otherMoney,jdbcType=DECIMAL},
</if>
<if test="record.othermoneylist != null">
OtherMoneyList = #{record.othermoneylist,jdbcType=VARCHAR},
<if test="record.otherMoneyList != null">
other_money_list = #{record.otherMoneyList,jdbcType=VARCHAR},
</if>
<if test="record.othermoneyitem != null">
OtherMoneyItem = #{record.othermoneyitem,jdbcType=VARCHAR},
<if test="record.otherMoneyItem != null">
other_money_item = #{record.otherMoneyItem,jdbcType=VARCHAR},
</if>
<if test="record.accountday != null">
AccountDay = #{record.accountday,jdbcType=INTEGER},
<if test="record.accountDay != null">
account_day = #{record.accountDay,jdbcType=INTEGER},
</if>
<if test="record.status != null">
Status = #{record.status,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.linknumber != null">
LinkNumber = #{record.linknumber,jdbcType=VARCHAR},
<if test="record.linkNumber != null">
link_number = #{record.linkNumber,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@@ -431,160 +432,160 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_depothead
set Id = #{record.id,jdbcType=BIGINT},
Type = #{record.type,jdbcType=VARCHAR},
SubType = #{record.subtype,jdbcType=VARCHAR},
DefaultNumber = #{record.defaultnumber,jdbcType=VARCHAR},
Number = #{record.number,jdbcType=VARCHAR},
OperPersonName = #{record.operpersonname,jdbcType=VARCHAR},
CreateTime = #{record.createtime,jdbcType=TIMESTAMP},
OperTime = #{record.opertime,jdbcType=TIMESTAMP},
OrganId = #{record.organid,jdbcType=BIGINT},
HandsPersonId = #{record.handspersonid,jdbcType=BIGINT},
AccountId = #{record.accountid,jdbcType=BIGINT},
ChangeAmount = #{record.changeamount,jdbcType=DECIMAL},
TotalPrice = #{record.totalprice,jdbcType=DECIMAL},
PayType = #{record.paytype,jdbcType=VARCHAR},
Remark = #{record.remark,jdbcType=VARCHAR},
Salesman = #{record.salesman,jdbcType=VARCHAR},
AccountIdList = #{record.accountidlist,jdbcType=VARCHAR},
AccountMoneyList = #{record.accountmoneylist,jdbcType=VARCHAR},
Discount = #{record.discount,jdbcType=DECIMAL},
DiscountMoney = #{record.discountmoney,jdbcType=DECIMAL},
DiscountLastMoney = #{record.discountlastmoney,jdbcType=DECIMAL},
OtherMoney = #{record.othermoney,jdbcType=DECIMAL},
OtherMoneyList = #{record.othermoneylist,jdbcType=VARCHAR},
OtherMoneyItem = #{record.othermoneyitem,jdbcType=VARCHAR},
AccountDay = #{record.accountday,jdbcType=INTEGER},
Status = #{record.status,jdbcType=VARCHAR},
LinkNumber = #{record.linknumber,jdbcType=VARCHAR},
update jsh_depot_head
set id = #{record.id,jdbcType=BIGINT},
type = #{record.type,jdbcType=VARCHAR},
sub_type = #{record.subType,jdbcType=VARCHAR},
default_number = #{record.defaultNumber,jdbcType=VARCHAR},
number = #{record.number,jdbcType=VARCHAR},
oper_person_name = #{record.operPersonName,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
oper_time = #{record.operTime,jdbcType=TIMESTAMP},
organ_id = #{record.organId,jdbcType=BIGINT},
hands_person_id = #{record.handsPersonId,jdbcType=BIGINT},
account_id = #{record.accountId,jdbcType=BIGINT},
change_amount = #{record.changeAmount,jdbcType=DECIMAL},
total_price = #{record.totalPrice,jdbcType=DECIMAL},
pay_type = #{record.payType,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
sales_man = #{record.salesMan,jdbcType=VARCHAR},
account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
discount = #{record.discount,jdbcType=DECIMAL},
discount_money = #{record.discountMoney,jdbcType=DECIMAL},
discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
other_money = #{record.otherMoney,jdbcType=DECIMAL},
other_money_list = #{record.otherMoneyList,jdbcType=VARCHAR},
other_money_item = #{record.otherMoneyItem,jdbcType=VARCHAR},
account_day = #{record.accountDay,jdbcType=INTEGER},
status = #{record.status,jdbcType=VARCHAR},
link_number = #{record.linkNumber,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
update jsh_depothead
update jsh_depot_head
<set>
<if test="type != null">
Type = #{type,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
</if>
<if test="subtype != null">
SubType = #{subtype,jdbcType=VARCHAR},
<if test="subType != null">
sub_type = #{subType,jdbcType=VARCHAR},
</if>
<if test="defaultnumber != null">
DefaultNumber = #{defaultnumber,jdbcType=VARCHAR},
<if test="defaultNumber != null">
default_number = #{defaultNumber,jdbcType=VARCHAR},
</if>
<if test="number != null">
Number = #{number,jdbcType=VARCHAR},
number = #{number,jdbcType=VARCHAR},
</if>
<if test="operpersonname != null">
OperPersonName = #{operpersonname,jdbcType=VARCHAR},
<if test="operPersonName != null">
oper_person_name = #{operPersonName,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
CreateTime = #{createtime,jdbcType=TIMESTAMP},
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="opertime != null">
OperTime = #{opertime,jdbcType=TIMESTAMP},
<if test="operTime != null">
oper_time = #{operTime,jdbcType=TIMESTAMP},
</if>
<if test="organid != null">
OrganId = #{organid,jdbcType=BIGINT},
<if test="organId != null">
organ_id = #{organId,jdbcType=BIGINT},
</if>
<if test="handspersonid != null">
HandsPersonId = #{handspersonid,jdbcType=BIGINT},
<if test="handsPersonId != null">
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
</if>
<if test="accountid != null">
AccountId = #{accountid,jdbcType=BIGINT},
<if test="accountId != null">
account_id = #{accountId,jdbcType=BIGINT},
</if>
<if test="changeamount != null">
ChangeAmount = #{changeamount,jdbcType=DECIMAL},
<if test="changeAmount != null">
change_amount = #{changeAmount,jdbcType=DECIMAL},
</if>
<if test="totalprice != null">
TotalPrice = #{totalprice,jdbcType=DECIMAL},
<if test="totalPrice != null">
total_price = #{totalPrice,jdbcType=DECIMAL},
</if>
<if test="paytype != null">
PayType = #{paytype,jdbcType=VARCHAR},
<if test="payType != null">
pay_type = #{payType,jdbcType=VARCHAR},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="salesman != null">
Salesman = #{salesman,jdbcType=VARCHAR},
<if test="salesMan != null">
sales_man = #{salesMan,jdbcType=VARCHAR},
</if>
<if test="accountidlist != null">
AccountIdList = #{accountidlist,jdbcType=VARCHAR},
<if test="accountIdList != null">
account_id_list = #{accountIdList,jdbcType=VARCHAR},
</if>
<if test="accountmoneylist != null">
AccountMoneyList = #{accountmoneylist,jdbcType=VARCHAR},
<if test="accountMoneyList != null">
account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
</if>
<if test="discount != null">
Discount = #{discount,jdbcType=DECIMAL},
discount = #{discount,jdbcType=DECIMAL},
</if>
<if test="discountmoney != null">
DiscountMoney = #{discountmoney,jdbcType=DECIMAL},
<if test="discountMoney != null">
discount_money = #{discountMoney,jdbcType=DECIMAL},
</if>
<if test="discountlastmoney != null">
DiscountLastMoney = #{discountlastmoney,jdbcType=DECIMAL},
<if test="discountLastMoney != null">
discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
</if>
<if test="othermoney != null">
OtherMoney = #{othermoney,jdbcType=DECIMAL},
<if test="otherMoney != null">
other_money = #{otherMoney,jdbcType=DECIMAL},
</if>
<if test="othermoneylist != null">
OtherMoneyList = #{othermoneylist,jdbcType=VARCHAR},
<if test="otherMoneyList != null">
other_money_list = #{otherMoneyList,jdbcType=VARCHAR},
</if>
<if test="othermoneyitem != null">
OtherMoneyItem = #{othermoneyitem,jdbcType=VARCHAR},
<if test="otherMoneyItem != null">
other_money_item = #{otherMoneyItem,jdbcType=VARCHAR},
</if>
<if test="accountday != null">
AccountDay = #{accountday,jdbcType=INTEGER},
<if test="accountDay != null">
account_day = #{accountDay,jdbcType=INTEGER},
</if>
<if test="status != null">
Status = #{status,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
</if>
<if test="linknumber != null">
LinkNumber = #{linknumber,jdbcType=VARCHAR},
<if test="linkNumber != null">
link_number = #{linkNumber,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotHead">
update jsh_depothead
set Type = #{type,jdbcType=VARCHAR},
SubType = #{subtype,jdbcType=VARCHAR},
DefaultNumber = #{defaultnumber,jdbcType=VARCHAR},
Number = #{number,jdbcType=VARCHAR},
OperPersonName = #{operpersonname,jdbcType=VARCHAR},
CreateTime = #{createtime,jdbcType=TIMESTAMP},
OperTime = #{opertime,jdbcType=TIMESTAMP},
OrganId = #{organid,jdbcType=BIGINT},
HandsPersonId = #{handspersonid,jdbcType=BIGINT},
AccountId = #{accountid,jdbcType=BIGINT},
ChangeAmount = #{changeamount,jdbcType=DECIMAL},
TotalPrice = #{totalprice,jdbcType=DECIMAL},
PayType = #{paytype,jdbcType=VARCHAR},
Remark = #{remark,jdbcType=VARCHAR},
Salesman = #{salesman,jdbcType=VARCHAR},
AccountIdList = #{accountidlist,jdbcType=VARCHAR},
AccountMoneyList = #{accountmoneylist,jdbcType=VARCHAR},
Discount = #{discount,jdbcType=DECIMAL},
DiscountMoney = #{discountmoney,jdbcType=DECIMAL},
DiscountLastMoney = #{discountlastmoney,jdbcType=DECIMAL},
OtherMoney = #{othermoney,jdbcType=DECIMAL},
OtherMoneyList = #{othermoneylist,jdbcType=VARCHAR},
OtherMoneyItem = #{othermoneyitem,jdbcType=VARCHAR},
AccountDay = #{accountday,jdbcType=INTEGER},
Status = #{status,jdbcType=VARCHAR},
LinkNumber = #{linknumber,jdbcType=VARCHAR},
update jsh_depot_head
set type = #{type,jdbcType=VARCHAR},
sub_type = #{subType,jdbcType=VARCHAR},
default_number = #{defaultNumber,jdbcType=VARCHAR},
number = #{number,jdbcType=VARCHAR},
oper_person_name = #{operPersonName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
oper_time = #{operTime,jdbcType=TIMESTAMP},
organ_id = #{organId,jdbcType=BIGINT},
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
account_id = #{accountId,jdbcType=BIGINT},
change_amount = #{changeAmount,jdbcType=DECIMAL},
total_price = #{totalPrice,jdbcType=DECIMAL},
pay_type = #{payType,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
sales_man = #{salesMan,jdbcType=VARCHAR},
account_id_list = #{accountIdList,jdbcType=VARCHAR},
account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
discount = #{discount,jdbcType=DECIMAL},
discount_money = #{discountMoney,jdbcType=DECIMAL},
discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
other_money = #{otherMoney,jdbcType=DECIMAL},
other_money_list = #{otherMoneyList,jdbcType=VARCHAR},
other_money_item = #{otherMoneyItem,jdbcType=VARCHAR},
account_day = #{accountDay,jdbcType=INTEGER},
status = #{status,jdbcType=VARCHAR},
link_number = #{linkNumber,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -31,47 +31,47 @@
</resultMap>
<resultMap id="ResultStatementAccount" type="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount">
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="number" jdbcType="VARCHAR" property="number" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="DiscountLastMoney" jdbcType="DECIMAL" property="discountLastMoney" />
<result column="OtherMoney" jdbcType="DECIMAL" property="otherMoney" />
<result column="ChangeAmount" jdbcType="DECIMAL" property="changeAmount" />
<result column="discount_last_money" jdbcType="DECIMAL" property="discountLastMoney" />
<result column="other_money" jdbcType="DECIMAL" property="otherMoney" />
<result column="change_amount" jdbcType="DECIMAL" property="changeAmount" />
<result column="supplierName" jdbcType="VARCHAR" property="supplierName" />
<result column="oTime" jdbcType="VARCHAR" property="oTime" />
</resultMap>
<select id="selectByConditionDepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select distinct dh.*, s.supplier OrganName, p.name HandsPersonName, a.name AccountName
from jsh_depothead dh
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_depotitem di on dh.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
from jsh_depot_head dh
left join jsh_supplier s on dh.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.hands_person_id=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_depot_item di on dh.id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.id and ifnull(m.delete_flag,'0') !='1'
where 1=1
<if test="type != null">
and dh.Type='${type}'
and dh.type='${type}'
</if>
<if test="subType != null">
and dh.SubType='${subType}'
and dh.sub_type='${subType}'
</if>
<if test="number != null">
and dh.Number like '%${number}%'
and dh.number like '%${number}%'
</if>
<if test="beginTime != null">
and dh.OperTime >= '${beginTime}'
and dh.oper_time >= '${beginTime}'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
<if test="materialParam != null">
and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
</if>
<if test="depotIds != null">
and di.DepotId in (${depotIds})
and di.depot_id in (${depotIds})
</if>
and ifnull(dh.delete_Flag,'0') !='1'
order by dh.Id desc
and ifnull(dh.delete_flag,'0') !='1'
order by dh.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -79,69 +79,69 @@
<select id="countsByDepotHead" resultType="java.lang.Long">
SELECT
COUNT(1) from
(select distinct jsh_depothead.* FROM jsh_depothead
left join jsh_depotitem di on jsh_depothead.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
(select distinct jsh_depot_head.* FROM jsh_depot_head
left join jsh_depot_item di on jsh_depot_head.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
WHERE 1=1
<if test="type != null">
and Type='${type}'
and type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
and sub_type='${subType}'
</if>
<if test="number != null">
and Number like '%${number}%'
and number like '%${number}%'
</if>
<if test="beginTime != null">
and OperTime >= '${beginTime}'
and oper_time >= '${beginTime}'
</if>
<if test="endTime != null">
and OperTime &lt;= '${endTime}'
and oper_time &lt;= '${endTime}'
</if>
<if test="materialParam != null">
and (m.`Name` like '%${materialParam}%' or m.Model like '%${materialParam}%')
</if>
<if test="depotIds != null">
and di.DepotId in (${depotIds})
and di.depot_id in (${depotIds})
</if>
and ifnull(jsh_depothead.delete_Flag,'0') !='1') tb
and ifnull(jsh_depot_head.delete_Flag,'0') !='1') tb
</select>
<select id="getMaxId" resultType="java.lang.Long">
select max(Id) as Id from jsh_depothead
select max(id) as id from jsh_depot_head
</select>
<select id="findMaterialsListByHeaderId" resultType="java.lang.String">
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
from jsh_depotitem
inner join jsh_material on jsh_depotitem.MaterialId = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
where jsh_depotitem.HeaderId = ${id}
and ifnull(jsh_depotitem.delete_Flag,'0') !='1'
from jsh_depot_item
inner join jsh_material on jsh_depot_item.material_id = jsh_material.Id and ifnull(jsh_material.delete_Flag,'0') !='1'
where jsh_depot_item.header_id = ${id}
and ifnull(jsh_depot_item.delete_flag,'0') !='1'
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select dh.Number,m.`name` MName,m.Model,di.UnitPrice,di.OperNumber,di.AllPrice,s.supplier SName,d.dName DName,
date_format(dh.OperTime, '%Y-%m-%d') OperTime, concat(dh.SubType,dh.Type) as NewType
from jsh_depothead dh
inner join jsh_depotitem di on di.HeaderId=dh.id and ifnull(di.delete_Flag,'0') !='1'
inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1'
where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
select dh.number,m.`name` MName,m.model,di.unit_price,di.oper_number,di.all_price,s.supplier SName,d.dName DName,
date_format(dh.oper_time, '%Y-%m-%d') OperTime, concat(dh.sub_type,dh.type) as NewType
from jsh_depot_head dh
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot ) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
where dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="oId != null">
and dh.OrganId = ${oId}
and dh.organ_id = ${oId}
</if>
<if test="pid != null">
and di.DepotId = ${pid}
and di.depot_id = ${pid}
</if>
<if test="pid == null">
and di.DepotId in (${dids})
and di.depot_id in (${dids})
</if>
<if test="type != null">
and dh.Type='${type}'
and dh.type='${type}'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -149,81 +149,81 @@
<select id="findByAllCount" resultType="java.lang.Integer">
select count(1)
from jsh_depothead dh
inner join jsh_depotitem di on di.HeaderId=dh.id and ifnull(di.delete_Flag,'0') !='1'
inner join jsh_material m on m.id=di.MaterialId and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.DepotId and ifnull(d.delete_Flag,'0') !='1'
where dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
from jsh_depot_head dh
inner join jsh_depot_item di on di.header_id=dh.id and ifnull(di.delete_flag,'0') !='1'
inner join jsh_material m on m.id=di.material_id and ifnull(m.delete_Flag,'0') !='1'
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
inner join (select id,name as dName,delete_Flag from jsh_depot) d on d.id=di.depot_id and ifnull(d.delete_Flag,'0') !='1'
where dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="oId != null">
and dh.OrganId = ${oId}
and dh.organ_id = ${oId}
</if>
<if test="pid != null">
and di.DepotId = ${pid}
and di.depot_id = ${pid}
</if>
<if test="pid == null">
and di.DepotId in (${dids})
and di.depot_id in (${dids})
</if>
<if test="type != null">
and dh.Type='${type}'
and dh.type='${type}'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
ORDER BY OperTime DESC,Number desc
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oper_time DESC,number desc
</select>
<select id="findInOutMaterialCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultInOutMaterialCount">
select di.MaterialId, m.mName,m.Model,m.categoryName,
select di.material_id, m.mName,m.Model,m.categoryName,
(select sum(jdi.BasicNumber) numSum from jsh_depothead jdh
INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId
and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
(select sum(jdi.basic_number) numSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time &lt;='${endTime}'
<if test="oId != null">
and jdh.OrganId = ${oId}
and jdh.organ_id = ${oId}
</if>
<if test="pid != null">
and jdi.DepotId= ${pid}
and jdi.depot_id= ${pid}
</if>
<if test="pid == null">
and jdi.DepotId in (${dids})
and jdi.depot_id in (${dids})
</if>
and ifnull(jdh.delete_Flag,'0') !='1'
and ifnull(jdh.delete_flag,'0') !='1'
) numSum,
(select sum(jdi.AllPrice) priceSum from jsh_depothead jdh
INNER JOIN jsh_depotitem jdi on jdh.id=jdi.HeaderId and ifnull(jdi.delete_Flag,'0') !='1'
where jdi.MaterialId=di.MaterialId
and jdh.type='${type}' and jdh.OperTime >='${beginTime}' and jdh.OperTime &lt;='${endTime}'
(select sum(jdi.all_price) priceSum from jsh_depot_head jdh
INNER JOIN jsh_depot_item jdi on jdh.id=jdi.header_id and ifnull(jdi.delete_flag,'0') !='1'
where jdi.material_id=di.material_id
and jdh.type='${type}' and jdh.oper_time >='${beginTime}' and jdh.oper_time &lt;='${endTime}'
<if test="oId != null">
and jdh.OrganId = ${oId}
and jdh.organ_id = ${oId}
</if>
<if test="pid != null">
and jdi.DepotId= ${pid}
and jdi.depot_id= ${pid}
</if>
<if test="pid == null">
and jdi.DepotId in (${dids})
and jdi.depot_id in (${dids})
</if>
and ifnull(jdh.delete_Flag,'0') !='1'
and ifnull(jdh.delete_flag,'0') !='1'
) priceSum
from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_material_category on jsh_material.CategoryId=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m
on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="oId != null">
and dh.OrganId = ${oId}
and dh.organ_id = ${oId}
</if>
<if test="pid != null">
and di.DepotId= ${pid}
and di.depot_id= ${pid}
</if>
<if test="pid == null">
and di.DepotId in (${dids})
and di.depot_id in (${dids})
</if>
and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName
and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.categoryName
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -231,46 +231,46 @@
<select id="findInOutMaterialCountTotal" resultType="java.lang.Integer">
select count(1) from
(select di.MaterialId, m.mName,m.Model,m.categoryName from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
(select di.material_id, m.mName,m.Model,m.categoryName from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_material_category.`Name` categoryName
from jsh_material
LEFT JOIN jsh_material_category on jsh_material.CategoryId=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.MaterialId where dh.type='${type}' and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
) m on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="oId != null">
and dh.OrganId = ${oId}
and dh.organ_id = ${oId}
</if>
<if test="pid != null">
and di.DepotId= ${pid}
and di.depot_id= ${pid}
</if>
<if test="pid == null">
and di.DepotId in (${dids})
and di.depot_id in (${dids})
</if>
and ifnull(dh.delete_Flag,'0') !='1'
GROUP BY di.MaterialId,m.mName,m.Model,m.categoryName) a
and ifnull(dh.delete_flag,'0') !='1'
GROUP BY di.material_id,m.mName,m.Model,m.categoryName) a
</select>
<select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount">
select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.OtherMoney,dh.ChangeAmount,s.supplier supplierName,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
select dh.number,concat(dh.sub_type,dh.type) as type,dh.discount_last_money,dh.other_money,dh.change_amount,s.supplier supplierName,
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depot_head dh
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="organId != null">
and dh.OrganId=${organId}
and dh.organ_id=${organId}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
UNION ALL
select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney, 0 OtherMoney,ah.ChangeAmount,s.supplier supplierName,
date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
select ah.bill_no number,ah.type as newType,ah.total_price discount_last_money, 0 other_money,ah.change_amount,s.supplier supplierName,
date_format(ah.bill_time,'%Y-%m-%d %H:%i:%S') as oTime from jsh_account_head ah
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}'
and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
and ah.bill_time >='${beginTime}' and ah.bill_time &lt;='${endTime}'
<if test="organId != null">
and ah.OrganId=${organId}
and ah.organ_id=${organId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
ORDER BY oTime
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -280,49 +280,49 @@
<select id="findStatementAccountCount" resultType="java.lang.Integer">
select sum(a) from
(
select count(1) a from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
and dh.OperTime >='${beginTime}' and dh.OperTime &lt;='${endTime}'
select count(1) a from jsh_depot_head dh
inner join jsh_supplier s on s.id=dh.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.sub_type!='其它' and dh.sub_type!='采购订单' and dh.sub_type!='销售订单')
and dh.oper_time >='${beginTime}' and dh.oper_time &lt;='${endTime}'
<if test="organId != null">
and dh.OrganId=${organId}
and dh.organ_id=${organId}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
UNION ALL
select count(1) a from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
select count(1) a from jsh_account_head ah
inner join jsh_supplier s on s.id=ah.organ_id and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}'
and ah.BillTime >='${beginTime}' and ah.BillTime &lt;='${endTime}'
and ah.bill_time >='${beginTime}' and ah.bill_time &lt;='${endTime}'
<if test="organId != null">
and ah.OrganId=${organId}
and ah.organ_id=${organId}
</if>
and ifnull(ah.delete_Flag,'0') !='1'
and ifnull(ah.delete_flag,'0') !='1'
) cc
</select>
<select id="findAllMoney" resultType="java.math.BigDecimal">
select ifnull(sum(${modeName}),0) as allMoney from jsh_depothead where Type='${type}' and SubType = '${subType}'
and OrganId =${supplierId} and OperTime &lt;='${endTime}'
and ifnull(delete_Flag,'0') !='1'
select ifnull(sum(${modeName}),0) as allMoney from jsh_depot_head where type='${type}' and sub_type = '${subType}'
and organ_id =${supplierId} and oper_time &lt;='${endTime}'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findAllOtherMoney" resultType="java.math.BigDecimal">
select ifnull(sum(OtherMoney),0) as allOtherMoney from jsh_depothead where Type='${type}' and SubType = '${subType}'
and OrganId =${supplierId} and OperTime &lt;='${endTime}'
and ifnull(delete_Flag,'0') !='1'
select ifnull(sum(other_money),0) as allOtherMoney from jsh_depot_head where type='${type}' and sub_type = '${subType}'
and organ_id =${supplierId} and oper_time &lt;='${endTime}'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select dh.*, s.supplier OrganName, p.name HandsPersonName, a.name AccountName
from jsh_depothead dh
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
from jsh_depot_head dh
left join jsh_supplier s on dh.organ_id=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.hands_person_id=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.account_id=a.id and ifnull(a.delete_Flag,'0') !='1'
where 1=1
<if test="number != null">
and dh.Number='${number}'
and dh.number='${number}'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
</select>
<update id="updateBuildOnlyNumber">
@@ -334,8 +334,8 @@
</select>
<update id="batchDeleteDepotHeadByIds">
update jsh_depothead
set delete_Flag='1'
update jsh_depot_head
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
@@ -346,89 +346,89 @@
<select id="getDepotHeadListByAccountIds" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" />
from jsh_depothead
from jsh_depot_head
where 1=1
and accountId in (
and account_id in (
<foreach collection="accountIds" item="accountId" separator=",">
#{accountId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDepotHeadListByOrganIds" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" />
from jsh_depothead
from jsh_depot_head
where 1=1
and organId in (
and organ_id in (
<foreach collection="organIds" item="organId" separator=",">
#{organId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDepotHeadListByHandsPersonIds" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" />
from jsh_depothead
from jsh_depot_head
where 1=1
and handsPersonId in (
and hands_person_id in (
<foreach collection="handsPersonIds" item="handsPersonId" separator=",">
#{handsPersonId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getBuyAndSaleStatistics" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(DiscountLastMoney),0)
FROM jsh_depothead
ifnull(sum(discount_last_money),0)
FROM jsh_depot_head
WHERE 1=1
<if test="type != null">
and Type='${type}'
and type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
and sub_type='${subType}'
</if>
<if test="hasSupplier == 1">
and OrganId is not null
and organ_id is not null
</if>
<if test="hasSupplier == 0">
and OrganId is null
and organ_id is null
</if>
<if test="beginTime != null">
and OperTime >= '${beginTime}'
and oper_time >= '${beginTime}'
</if>
<if test="endTime != null">
and OperTime &lt;= '${endTime}'
and oper_time &lt;= '${endTime}'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(TotalPrice),0)
FROM jsh_depothead
ifnull(sum(total_price),0)
FROM jsh_depot_head
WHERE 1=1
<if test="type != null">
and Type='${type}'
and type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
and sub_type='${subType}'
</if>
<if test="hasSupplier == 1">
and OrganId is not null
and organ_id is not null
</if>
<if test="hasSupplier == 0">
and OrganId is null
and organ_id is null
</if>
<if test="beginTime != null">
and OperTime >= '${beginTime}'
and oper_time >= '${beginTime}'
</if>
<if test="endTime != null">
and OperTime &lt;= '${endTime}'
and oper_time &lt;= '${endTime}'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
</mapper>

View File

@@ -2,32 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.DepotItemMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotItem">
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="HeaderId" jdbcType="BIGINT" property="headerid" />
<result column="MaterialId" jdbcType="BIGINT" property="materialid" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="header_id" jdbcType="BIGINT" property="headerId" />
<result column="material_id" jdbcType="BIGINT" property="materialId" />
<result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" />
<result column="MUnit" jdbcType="VARCHAR" property="munit" />
<result column="OperNumber" jdbcType="DECIMAL" property="opernumber" />
<result column="BasicNumber" jdbcType="DECIMAL" property="basicnumber" />
<result column="UnitPrice" jdbcType="DECIMAL" property="unitprice" />
<result column="TaxUnitPrice" jdbcType="DECIMAL" property="taxunitprice" />
<result column="AllPrice" jdbcType="DECIMAL" property="allprice" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="Img" jdbcType="VARCHAR" property="img" />
<result column="Incidentals" jdbcType="DECIMAL" property="incidentals" />
<result column="DepotId" jdbcType="BIGINT" property="depotid" />
<result column="AnotherDepotId" jdbcType="BIGINT" property="anotherdepotid" />
<result column="TaxRate" jdbcType="DECIMAL" property="taxrate" />
<result column="TaxMoney" jdbcType="DECIMAL" property="taxmoney" />
<result column="TaxLastMoney" jdbcType="DECIMAL" property="taxlastmoney" />
<result column="OtherField1" jdbcType="VARCHAR" property="otherfield1" />
<result column="OtherField2" jdbcType="VARCHAR" property="otherfield2" />
<result column="OtherField3" jdbcType="VARCHAR" property="otherfield3" />
<result column="OtherField4" jdbcType="VARCHAR" property="otherfield4" />
<result column="OtherField5" jdbcType="VARCHAR" property="otherfield5" />
<result column="MType" jdbcType="VARCHAR" property="mtype" />
<result column="material_unit" jdbcType="VARCHAR" property="materialUnit" />
<result column="oper_number" jdbcType="DECIMAL" property="operNumber" />
<result column="basic_number" jdbcType="DECIMAL" property="basicNumber" />
<result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
<result column="tax_unit_price" jdbcType="DECIMAL" property="taxUnitPrice" />
<result column="all_price" jdbcType="DECIMAL" property="allPrice" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="img" jdbcType="VARCHAR" property="img" />
<result column="incidentals" jdbcType="DECIMAL" property="incidentals" />
<result column="depot_id" jdbcType="BIGINT" property="depotId" />
<result column="another_depot_id" jdbcType="BIGINT" property="anotherDepotId" />
<result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
<result column="tax_money" jdbcType="DECIMAL" property="taxMoney" />
<result column="tax_last_money" jdbcType="DECIMAL" property="taxLastMoney" />
<result column="other_field1" jdbcType="VARCHAR" property="otherField1" />
<result column="other_field2" jdbcType="VARCHAR" property="otherField2" />
<result column="other_field3" jdbcType="VARCHAR" property="otherField3" />
<result column="other_field4" jdbcType="VARCHAR" property="otherField4" />
<result column="other_field5" jdbcType="VARCHAR" property="otherField5" />
<result column="material_type" jdbcType="VARCHAR" property="materialType" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -88,10 +88,10 @@
</where>
</sql>
<sql id="Base_Column_List">
Id, HeaderId, MaterialId, material_extend_id, MUnit, OperNumber, BasicNumber, UnitPrice,
TaxUnitPrice, AllPrice, Remark, Img, Incidentals, DepotId, AnotherDepotId, TaxRate,
TaxMoney, TaxLastMoney, OtherField1, OtherField2, OtherField3, OtherField4, OtherField5,
MType, tenant_id, delete_Flag
id, header_id, material_id, material_extend_id, material_unit, oper_number, basic_number,
unit_price, tax_unit_price, all_price, remark, img, incidentals, depot_id, another_depot_id,
tax_rate, tax_money, tax_last_money, other_field1, other_field2, other_field3, other_field4,
other_field5, material_type, tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
select
@@ -99,7 +99,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from jsh_depotitem
from jsh_depot_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@@ -110,151 +110,151 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_depotitem
where Id = #{id,jdbcType=BIGINT}
from jsh_depot_item
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_depotitem
where Id = #{id,jdbcType=BIGINT}
delete from jsh_depot_item
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
delete from jsh_depotitem
delete from jsh_depot_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depotitem (Id, HeaderId, MaterialId,
material_extend_id, MUnit, OperNumber,
BasicNumber, UnitPrice, TaxUnitPrice,
AllPrice, Remark, Img,
Incidentals, DepotId, AnotherDepotId,
TaxRate, TaxMoney, TaxLastMoney,
OtherField1, OtherField2, OtherField3,
OtherField4, OtherField5, MType,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{headerid,jdbcType=BIGINT}, #{materialid,jdbcType=BIGINT},
#{materialExtendId,jdbcType=BIGINT}, #{munit,jdbcType=VARCHAR}, #{opernumber,jdbcType=DECIMAL},
#{basicnumber,jdbcType=DECIMAL}, #{unitprice,jdbcType=DECIMAL}, #{taxunitprice,jdbcType=DECIMAL},
#{allprice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR},
#{incidentals,jdbcType=DECIMAL}, #{depotid,jdbcType=BIGINT}, #{anotherdepotid,jdbcType=BIGINT},
#{taxrate,jdbcType=DECIMAL}, #{taxmoney,jdbcType=DECIMAL}, #{taxlastmoney,jdbcType=DECIMAL},
#{otherfield1,jdbcType=VARCHAR}, #{otherfield2,jdbcType=VARCHAR}, #{otherfield3,jdbcType=VARCHAR},
#{otherfield4,jdbcType=VARCHAR}, #{otherfield5,jdbcType=VARCHAR}, #{mtype,jdbcType=VARCHAR},
insert into jsh_depot_item (id, header_id, material_id,
material_extend_id, material_unit, oper_number,
basic_number, unit_price, tax_unit_price,
all_price, remark, img,
incidentals, depot_id, another_depot_id,
tax_rate, tax_money, tax_last_money,
other_field1, other_field2, other_field3,
other_field4, other_field5, material_type,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{operNumber,jdbcType=DECIMAL},
#{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL}, #{taxUnitPrice,jdbcType=DECIMAL},
#{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{img,jdbcType=VARCHAR},
#{incidentals,jdbcType=DECIMAL}, #{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT},
#{taxRate,jdbcType=DECIMAL}, #{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL},
#{otherField1,jdbcType=VARCHAR}, #{otherField2,jdbcType=VARCHAR}, #{otherField3,jdbcType=VARCHAR},
#{otherField4,jdbcType=VARCHAR}, #{otherField5,jdbcType=VARCHAR}, #{materialType,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
insert into jsh_depotitem
insert into jsh_depot_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
id,
</if>
<if test="headerid != null">
HeaderId,
<if test="headerId != null">
header_id,
</if>
<if test="materialid != null">
MaterialId,
<if test="materialId != null">
material_id,
</if>
<if test="materialExtendId != null">
material_extend_id,
</if>
<if test="munit != null">
MUnit,
<if test="materialUnit != null">
material_unit,
</if>
<if test="opernumber != null">
OperNumber,
<if test="operNumber != null">
oper_number,
</if>
<if test="basicnumber != null">
BasicNumber,
<if test="basicNumber != null">
basic_number,
</if>
<if test="unitprice != null">
UnitPrice,
<if test="unitPrice != null">
unit_price,
</if>
<if test="taxunitprice != null">
TaxUnitPrice,
<if test="taxUnitPrice != null">
tax_unit_price,
</if>
<if test="allprice != null">
AllPrice,
<if test="allPrice != null">
all_price,
</if>
<if test="remark != null">
Remark,
remark,
</if>
<if test="img != null">
Img,
img,
</if>
<if test="incidentals != null">
Incidentals,
incidentals,
</if>
<if test="depotid != null">
DepotId,
<if test="depotId != null">
depot_id,
</if>
<if test="anotherdepotid != null">
AnotherDepotId,
<if test="anotherDepotId != null">
another_depot_id,
</if>
<if test="taxrate != null">
TaxRate,
<if test="taxRate != null">
tax_rate,
</if>
<if test="taxmoney != null">
TaxMoney,
<if test="taxMoney != null">
tax_money,
</if>
<if test="taxlastmoney != null">
TaxLastMoney,
<if test="taxLastMoney != null">
tax_last_money,
</if>
<if test="otherfield1 != null">
OtherField1,
<if test="otherField1 != null">
other_field1,
</if>
<if test="otherfield2 != null">
OtherField2,
<if test="otherField2 != null">
other_field2,
</if>
<if test="otherfield3 != null">
OtherField3,
<if test="otherField3 != null">
other_field3,
</if>
<if test="otherfield4 != null">
OtherField4,
<if test="otherField4 != null">
other_field4,
</if>
<if test="otherfield5 != null">
OtherField5,
<if test="otherField5 != null">
other_field5,
</if>
<if test="mtype != null">
MType,
<if test="materialType != null">
material_type,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="headerid != null">
#{headerid,jdbcType=BIGINT},
<if test="headerId != null">
#{headerId,jdbcType=BIGINT},
</if>
<if test="materialid != null">
#{materialid,jdbcType=BIGINT},
<if test="materialId != null">
#{materialId,jdbcType=BIGINT},
</if>
<if test="materialExtendId != null">
#{materialExtendId,jdbcType=BIGINT},
</if>
<if test="munit != null">
#{munit,jdbcType=VARCHAR},
<if test="materialUnit != null">
#{materialUnit,jdbcType=VARCHAR},
</if>
<if test="opernumber != null">
#{opernumber,jdbcType=DECIMAL},
<if test="operNumber != null">
#{operNumber,jdbcType=DECIMAL},
</if>
<if test="basicnumber != null">
#{basicnumber,jdbcType=DECIMAL},
<if test="basicNumber != null">
#{basicNumber,jdbcType=DECIMAL},
</if>
<if test="unitprice != null">
#{unitprice,jdbcType=DECIMAL},
<if test="unitPrice != null">
#{unitPrice,jdbcType=DECIMAL},
</if>
<if test="taxunitprice != null">
#{taxunitprice,jdbcType=DECIMAL},
<if test="taxUnitPrice != null">
#{taxUnitPrice,jdbcType=DECIMAL},
</if>
<if test="allprice != null">
#{allprice,jdbcType=DECIMAL},
<if test="allPrice != null">
#{allPrice,jdbcType=DECIMAL},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
@@ -265,38 +265,38 @@
<if test="incidentals != null">
#{incidentals,jdbcType=DECIMAL},
</if>
<if test="depotid != null">
#{depotid,jdbcType=BIGINT},
<if test="depotId != null">
#{depotId,jdbcType=BIGINT},
</if>
<if test="anotherdepotid != null">
#{anotherdepotid,jdbcType=BIGINT},
<if test="anotherDepotId != null">
#{anotherDepotId,jdbcType=BIGINT},
</if>
<if test="taxrate != null">
#{taxrate,jdbcType=DECIMAL},
<if test="taxRate != null">
#{taxRate,jdbcType=DECIMAL},
</if>
<if test="taxmoney != null">
#{taxmoney,jdbcType=DECIMAL},
<if test="taxMoney != null">
#{taxMoney,jdbcType=DECIMAL},
</if>
<if test="taxlastmoney != null">
#{taxlastmoney,jdbcType=DECIMAL},
<if test="taxLastMoney != null">
#{taxLastMoney,jdbcType=DECIMAL},
</if>
<if test="otherfield1 != null">
#{otherfield1,jdbcType=VARCHAR},
<if test="otherField1 != null">
#{otherField1,jdbcType=VARCHAR},
</if>
<if test="otherfield2 != null">
#{otherfield2,jdbcType=VARCHAR},
<if test="otherField2 != null">
#{otherField2,jdbcType=VARCHAR},
</if>
<if test="otherfield3 != null">
#{otherfield3,jdbcType=VARCHAR},
<if test="otherField3 != null">
#{otherField3,jdbcType=VARCHAR},
</if>
<if test="otherfield4 != null">
#{otherfield4,jdbcType=VARCHAR},
<if test="otherField4 != null">
#{otherField4,jdbcType=VARCHAR},
</if>
<if test="otherfield5 != null">
#{otherfield5,jdbcType=VARCHAR},
<if test="otherField5 != null">
#{otherField5,jdbcType=VARCHAR},
</if>
<if test="mtype != null">
#{mtype,jdbcType=VARCHAR},
<if test="materialType != null">
#{materialType,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
@@ -307,91 +307,91 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
select count(*) from jsh_depotitem
select count(*) from jsh_depot_item
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_depotitem
update jsh_depot_item
<set>
<if test="record.id != null">
Id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.headerid != null">
HeaderId = #{record.headerid,jdbcType=BIGINT},
<if test="record.headerId != null">
header_id = #{record.headerId,jdbcType=BIGINT},
</if>
<if test="record.materialid != null">
MaterialId = #{record.materialid,jdbcType=BIGINT},
<if test="record.materialId != null">
material_id = #{record.materialId,jdbcType=BIGINT},
</if>
<if test="record.materialExtendId != null">
material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
</if>
<if test="record.munit != null">
MUnit = #{record.munit,jdbcType=VARCHAR},
<if test="record.materialUnit != null">
material_unit = #{record.materialUnit,jdbcType=VARCHAR},
</if>
<if test="record.opernumber != null">
OperNumber = #{record.opernumber,jdbcType=DECIMAL},
<if test="record.operNumber != null">
oper_number = #{record.operNumber,jdbcType=DECIMAL},
</if>
<if test="record.basicnumber != null">
BasicNumber = #{record.basicnumber,jdbcType=DECIMAL},
<if test="record.basicNumber != null">
basic_number = #{record.basicNumber,jdbcType=DECIMAL},
</if>
<if test="record.unitprice != null">
UnitPrice = #{record.unitprice,jdbcType=DECIMAL},
<if test="record.unitPrice != null">
unit_price = #{record.unitPrice,jdbcType=DECIMAL},
</if>
<if test="record.taxunitprice != null">
TaxUnitPrice = #{record.taxunitprice,jdbcType=DECIMAL},
<if test="record.taxUnitPrice != null">
tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
</if>
<if test="record.allprice != null">
AllPrice = #{record.allprice,jdbcType=DECIMAL},
<if test="record.allPrice != null">
all_price = #{record.allPrice,jdbcType=DECIMAL},
</if>
<if test="record.remark != null">
Remark = #{record.remark,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.img != null">
Img = #{record.img,jdbcType=VARCHAR},
img = #{record.img,jdbcType=VARCHAR},
</if>
<if test="record.incidentals != null">
Incidentals = #{record.incidentals,jdbcType=DECIMAL},
incidentals = #{record.incidentals,jdbcType=DECIMAL},
</if>
<if test="record.depotid != null">
DepotId = #{record.depotid,jdbcType=BIGINT},
<if test="record.depotId != null">
depot_id = #{record.depotId,jdbcType=BIGINT},
</if>
<if test="record.anotherdepotid != null">
AnotherDepotId = #{record.anotherdepotid,jdbcType=BIGINT},
<if test="record.anotherDepotId != null">
another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
</if>
<if test="record.taxrate != null">
TaxRate = #{record.taxrate,jdbcType=DECIMAL},
<if test="record.taxRate != null">
tax_rate = #{record.taxRate,jdbcType=DECIMAL},
</if>
<if test="record.taxmoney != null">
TaxMoney = #{record.taxmoney,jdbcType=DECIMAL},
<if test="record.taxMoney != null">
tax_money = #{record.taxMoney,jdbcType=DECIMAL},
</if>
<if test="record.taxlastmoney != null">
TaxLastMoney = #{record.taxlastmoney,jdbcType=DECIMAL},
<if test="record.taxLastMoney != null">
tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
</if>
<if test="record.otherfield1 != null">
OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
<if test="record.otherField1 != null">
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
</if>
<if test="record.otherfield2 != null">
OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
<if test="record.otherField2 != null">
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
</if>
<if test="record.otherfield3 != null">
OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
<if test="record.otherField3 != null">
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
</if>
<if test="record.otherfield4 != null">
OtherField4 = #{record.otherfield4,jdbcType=VARCHAR},
<if test="record.otherField4 != null">
other_field4 = #{record.otherField4,jdbcType=VARCHAR},
</if>
<if test="record.otherfield5 != null">
OtherField5 = #{record.otherfield5,jdbcType=VARCHAR},
<if test="record.otherField5 != null">
other_field5 = #{record.otherField5,jdbcType=VARCHAR},
</if>
<if test="record.mtype != null">
MType = #{record.mtype,jdbcType=VARCHAR},
<if test="record.materialType != null">
material_type = #{record.materialType,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@@ -399,145 +399,145 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_depotitem
set Id = #{record.id,jdbcType=BIGINT},
HeaderId = #{record.headerid,jdbcType=BIGINT},
MaterialId = #{record.materialid,jdbcType=BIGINT},
update jsh_depot_item
set id = #{record.id,jdbcType=BIGINT},
header_id = #{record.headerId,jdbcType=BIGINT},
material_id = #{record.materialId,jdbcType=BIGINT},
material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
MUnit = #{record.munit,jdbcType=VARCHAR},
OperNumber = #{record.opernumber,jdbcType=DECIMAL},
BasicNumber = #{record.basicnumber,jdbcType=DECIMAL},
UnitPrice = #{record.unitprice,jdbcType=DECIMAL},
TaxUnitPrice = #{record.taxunitprice,jdbcType=DECIMAL},
AllPrice = #{record.allprice,jdbcType=DECIMAL},
Remark = #{record.remark,jdbcType=VARCHAR},
Img = #{record.img,jdbcType=VARCHAR},
Incidentals = #{record.incidentals,jdbcType=DECIMAL},
DepotId = #{record.depotid,jdbcType=BIGINT},
AnotherDepotId = #{record.anotherdepotid,jdbcType=BIGINT},
TaxRate = #{record.taxrate,jdbcType=DECIMAL},
TaxMoney = #{record.taxmoney,jdbcType=DECIMAL},
TaxLastMoney = #{record.taxlastmoney,jdbcType=DECIMAL},
OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
OtherField4 = #{record.otherfield4,jdbcType=VARCHAR},
OtherField5 = #{record.otherfield5,jdbcType=VARCHAR},
MType = #{record.mtype,jdbcType=VARCHAR},
material_unit = #{record.materialUnit,jdbcType=VARCHAR},
oper_number = #{record.operNumber,jdbcType=DECIMAL},
basic_number = #{record.basicNumber,jdbcType=DECIMAL},
unit_price = #{record.unitPrice,jdbcType=DECIMAL},
tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
all_price = #{record.allPrice,jdbcType=DECIMAL},
remark = #{record.remark,jdbcType=VARCHAR},
img = #{record.img,jdbcType=VARCHAR},
incidentals = #{record.incidentals,jdbcType=DECIMAL},
depot_id = #{record.depotId,jdbcType=BIGINT},
another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
tax_rate = #{record.taxRate,jdbcType=DECIMAL},
tax_money = #{record.taxMoney,jdbcType=DECIMAL},
tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
other_field4 = #{record.otherField4,jdbcType=VARCHAR},
other_field5 = #{record.otherField5,jdbcType=VARCHAR},
material_type = #{record.materialType,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
update jsh_depotitem
update jsh_depot_item
<set>
<if test="headerid != null">
HeaderId = #{headerid,jdbcType=BIGINT},
<if test="headerId != null">
header_id = #{headerId,jdbcType=BIGINT},
</if>
<if test="materialid != null">
MaterialId = #{materialid,jdbcType=BIGINT},
<if test="materialId != null">
material_id = #{materialId,jdbcType=BIGINT},
</if>
<if test="materialExtendId != null">
material_extend_id = #{materialExtendId,jdbcType=BIGINT},
</if>
<if test="munit != null">
MUnit = #{munit,jdbcType=VARCHAR},
<if test="materialUnit != null">
material_unit = #{materialUnit,jdbcType=VARCHAR},
</if>
<if test="opernumber != null">
OperNumber = #{opernumber,jdbcType=DECIMAL},
<if test="operNumber != null">
oper_number = #{operNumber,jdbcType=DECIMAL},
</if>
<if test="basicnumber != null">
BasicNumber = #{basicnumber,jdbcType=DECIMAL},
<if test="basicNumber != null">
basic_number = #{basicNumber,jdbcType=DECIMAL},
</if>
<if test="unitprice != null">
UnitPrice = #{unitprice,jdbcType=DECIMAL},
<if test="unitPrice != null">
unit_price = #{unitPrice,jdbcType=DECIMAL},
</if>
<if test="taxunitprice != null">
TaxUnitPrice = #{taxunitprice,jdbcType=DECIMAL},
<if test="taxUnitPrice != null">
tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
</if>
<if test="allprice != null">
AllPrice = #{allprice,jdbcType=DECIMAL},
<if test="allPrice != null">
all_price = #{allPrice,jdbcType=DECIMAL},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="img != null">
Img = #{img,jdbcType=VARCHAR},
img = #{img,jdbcType=VARCHAR},
</if>
<if test="incidentals != null">
Incidentals = #{incidentals,jdbcType=DECIMAL},
incidentals = #{incidentals,jdbcType=DECIMAL},
</if>
<if test="depotid != null">
DepotId = #{depotid,jdbcType=BIGINT},
<if test="depotId != null">
depot_id = #{depotId,jdbcType=BIGINT},
</if>
<if test="anotherdepotid != null">
AnotherDepotId = #{anotherdepotid,jdbcType=BIGINT},
<if test="anotherDepotId != null">
another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
</if>
<if test="taxrate != null">
TaxRate = #{taxrate,jdbcType=DECIMAL},
<if test="taxRate != null">
tax_rate = #{taxRate,jdbcType=DECIMAL},
</if>
<if test="taxmoney != null">
TaxMoney = #{taxmoney,jdbcType=DECIMAL},
<if test="taxMoney != null">
tax_money = #{taxMoney,jdbcType=DECIMAL},
</if>
<if test="taxlastmoney != null">
TaxLastMoney = #{taxlastmoney,jdbcType=DECIMAL},
<if test="taxLastMoney != null">
tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
</if>
<if test="otherfield1 != null">
OtherField1 = #{otherfield1,jdbcType=VARCHAR},
<if test="otherField1 != null">
other_field1 = #{otherField1,jdbcType=VARCHAR},
</if>
<if test="otherfield2 != null">
OtherField2 = #{otherfield2,jdbcType=VARCHAR},
<if test="otherField2 != null">
other_field2 = #{otherField2,jdbcType=VARCHAR},
</if>
<if test="otherfield3 != null">
OtherField3 = #{otherfield3,jdbcType=VARCHAR},
<if test="otherField3 != null">
other_field3 = #{otherField3,jdbcType=VARCHAR},
</if>
<if test="otherfield4 != null">
OtherField4 = #{otherfield4,jdbcType=VARCHAR},
<if test="otherField4 != null">
other_field4 = #{otherField4,jdbcType=VARCHAR},
</if>
<if test="otherfield5 != null">
OtherField5 = #{otherfield5,jdbcType=VARCHAR},
<if test="otherField5 != null">
other_field5 = #{otherField5,jdbcType=VARCHAR},
</if>
<if test="mtype != null">
MType = #{mtype,jdbcType=VARCHAR},
<if test="materialType != null">
material_type = #{materialType,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
update jsh_depotitem
set HeaderId = #{headerid,jdbcType=BIGINT},
MaterialId = #{materialid,jdbcType=BIGINT},
update jsh_depot_item
set header_id = #{headerId,jdbcType=BIGINT},
material_id = #{materialId,jdbcType=BIGINT},
material_extend_id = #{materialExtendId,jdbcType=BIGINT},
MUnit = #{munit,jdbcType=VARCHAR},
OperNumber = #{opernumber,jdbcType=DECIMAL},
BasicNumber = #{basicnumber,jdbcType=DECIMAL},
UnitPrice = #{unitprice,jdbcType=DECIMAL},
TaxUnitPrice = #{taxunitprice,jdbcType=DECIMAL},
AllPrice = #{allprice,jdbcType=DECIMAL},
Remark = #{remark,jdbcType=VARCHAR},
Img = #{img,jdbcType=VARCHAR},
Incidentals = #{incidentals,jdbcType=DECIMAL},
DepotId = #{depotid,jdbcType=BIGINT},
AnotherDepotId = #{anotherdepotid,jdbcType=BIGINT},
TaxRate = #{taxrate,jdbcType=DECIMAL},
TaxMoney = #{taxmoney,jdbcType=DECIMAL},
TaxLastMoney = #{taxlastmoney,jdbcType=DECIMAL},
OtherField1 = #{otherfield1,jdbcType=VARCHAR},
OtherField2 = #{otherfield2,jdbcType=VARCHAR},
OtherField3 = #{otherfield3,jdbcType=VARCHAR},
OtherField4 = #{otherfield4,jdbcType=VARCHAR},
OtherField5 = #{otherfield5,jdbcType=VARCHAR},
MType = #{mtype,jdbcType=VARCHAR},
material_unit = #{materialUnit,jdbcType=VARCHAR},
oper_number = #{operNumber,jdbcType=DECIMAL},
basic_number = #{basicNumber,jdbcType=DECIMAL},
unit_price = #{unitPrice,jdbcType=DECIMAL},
tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
all_price = #{allPrice,jdbcType=DECIMAL},
remark = #{remark,jdbcType=VARCHAR},
img = #{img,jdbcType=VARCHAR},
incidentals = #{incidentals,jdbcType=DECIMAL},
depot_id = #{depotId,jdbcType=BIGINT},
another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
tax_rate = #{taxRate,jdbcType=DECIMAL},
tax_money = #{taxMoney,jdbcType=DECIMAL},
tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
other_field1 = #{otherField1,jdbcType=VARCHAR},
other_field2 = #{otherField2,jdbcType=VARCHAR},
other_field3 = #{otherField3,jdbcType=VARCHAR},
other_field4 = #{otherField4,jdbcType=VARCHAR},
other_field5 = #{otherField5,jdbcType=VARCHAR},
material_type = #{materialType,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -3,9 +3,9 @@
<mapper namespace="com.jsh.erp.datasource.mappers.DepotItemMapperEx">
<resultMap id="DetailByTypeAndMIdResultMap" type="com.jsh.erp.datasource.entities.DepotItemVo4DetailByTypeAndMId">
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="SubType" jdbcType="VARCHAR" property="subType" />
<result column="number" jdbcType="VARCHAR" property="number" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
<result column="b_num" jdbcType="BIGINT" property="bnum" />
<result column="oTime" jdbcType="TIMESTAMP" property="otime" />
</resultMap>
@@ -63,7 +63,7 @@
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
select *
FROM jsh_depotitem
FROM jsh_depot_item
where 1=1
<if test="name != null">
and name like '%${name}%'
@@ -74,7 +74,7 @@
<if test="remark != null">
and remark like '%${remark}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -83,7 +83,7 @@
<select id="countsByDepotItem" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_depotitem
FROM jsh_depot_item
WHERE 1=1
<if test="name != null">
and name like '%${name}%'
@@ -94,31 +94,31 @@
<if test="remark != null">
and remark like '%${remark}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
select dh.Number,dh.Type,dh.SubType,
select dh.number,dh.type,dh.sub_type,
case
when type='入库' then ifnull(di.BasicNumber,0)
when type='出库' then 0-di.BasicNumber
when dh.SubType='组装单' and di.MType='组合件' then ifnull(di.BasicNumber,0)
when dh.SubType='组装单' and di.MType='普通子件' then 0-di.BasicNumber
when dh.SubType='拆卸单' and di.MType='普通子件' then ifnull(di.BasicNumber,0)
when dh.SubType='拆卸单' and di.MType='组合件' then 0-di.BasicNumber
when dh.SubType='盘点复盘' then ifnull(di.BasicNumber,0)
when type='入库' then ifnull(di.basic_number,0)
when type='出库' then 0-di.basic_number
when dh.sub_type='组装单' and di.material_type='组合件' then ifnull(di.basic_number,0)
when dh.sub_type='组装单' and di.material_type='普通子件' then 0-di.basic_number
when dh.sub_type='拆卸单' and di.material_type='普通子件' then ifnull(di.basic_number,0)
when dh.sub_type='拆卸单' and di.material_type='组合件' then 0-di.basic_number
when dh.sub_type='盘点复盘' then ifnull(di.basic_number,0)
else 0
end
as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where ((dh.type!='其它' and dh.SubType!='调拨')
or (dh.type='其它' and dh.SubType='组装单')
or (dh.type='其它' and dh.SubType='拆卸单')
or (dh.type='其它' and dh.SubType='盘点复盘' and dh.Status=1))
and di.MaterialId =${mId}
and ifnull(dh.delete_Flag,'0') !='1'
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
where ((dh.type!='其它' and dh.sub_type!='调拨')
or (dh.type='其它' and dh.sub_type='组装单')
or (dh.type='其它' and dh.sub_type='拆卸单')
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
and di.material_id =${mId}
and ifnull(dh.delete_flag,'0') !='1'
ORDER BY oTime desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -127,39 +127,39 @@
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long">
select count(1)
from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where ((dh.type!='其它' and dh.SubType!='调拨')
or (dh.type='其它' and dh.SubType='组装单')
or (dh.type='其它' and dh.SubType='拆卸单')
or (dh.type='其它' and dh.SubType='盘点复盘' and dh.Status=1))
and di.MaterialId =${mId}
and ifnull(dh.delete_Flag,'0') !='1'
from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
where ((dh.type!='其它' and dh.sub_type!='调拨')
or (dh.type='其它' and dh.sub_type='组装单')
or (dh.type='其它' and dh.sub_type='拆卸单')
or (dh.type='其它' and dh.sub_type='盘点复盘' and dh.Status=1))
and di.material_id =${mId}
and ifnull(dh.delete_flag,'0') !='1'
</select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
select di.*,m.name MName,m.model MModel,m.unit MaterialUnit,m.color MColor,m.standard MStandard,m.mfrs MMfrs,
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, me.bar_code barCode
from jsh_depotitem di
left join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
from jsh_depot_item di
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_depot dp1 on di.DepotId=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.HeaderId = ${headerId}
and ifnull(di.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_depot dp1 on di.depot_id=dp1.id and ifnull(dp1.delete_Flag,'0') !='1'
left join jsh_depot dp2 on di.another_depot_id=dp2.id and ifnull(dp2.delete_Flag,'0') !='1'
where di.header_id = ${headerId}
and ifnull(di.delete_flag,'0') !='1'
order by di.id asc
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
select m.id MId, m.Name MName, m.Mfrs MMfrs, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.unit MaterialUnit, m.color MColor,
me.purchase_decimal, u.name unit_name
from jsh_material m
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1
and me.default_flag=1
<if test="name != null">
@@ -169,11 +169,11 @@
and m.model like '%${model}%'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.name
order by m.Name, m.Model asc
and ifnull(di.delete_flag,'0') !='1'
group by m.id,m.name, m.model, m.unit, m.color, me.purchase_decimal, u.name
order by m.name, m.model asc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -182,8 +182,8 @@
<select id="findByAllCount" resultType="java.lang.Integer">
select count(1) from (select m.id
from jsh_material m
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
left join jsh_depot_item di on di.material_id=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depot_head dh on di.header_id=dh.id and ifnull(dh.delete_flag,'0') !='1'
where 1=1
<if test="name != null">
and m.name like '%${name}%'
@@ -192,117 +192,117 @@
and m.model like '%${model}%'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
and ifnull(di.delete_Flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
group by m.id) cc
</select>
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =${MId}
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
select ifnull(sum(basic_number),0) as BasicNumber from jsh_depot_item di,jsh_depot_head dh
where di.header_id = dh.id
and dh.type='${type}' and dh.sub_type='${subType}'
and di.material_id =${MId}
and dh.oper_time &gt;= '${MonthTime}-01 00:00:00'
and dh.oper_time &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
</select>
<select id="buyOrSalePrice" resultType="java.math.BigDecimal">
select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =${MId}
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh
where di.header_id = dh.id
and dh.type='${type}' and dh.sub_type='${subType}'
and di.material_id =${MId}
and dh.oper_time &gt;= '${MonthTime}-01 00:00:00'
and dh.oper_time &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
</select>
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
select ifnull(sum(DiscountLastMoney),0) as allMoney from jsh_depothead dh
select ifnull(sum(discount_last_money),0) as allMoney from jsh_depot_head dh
where 1=1
and dh.type='${type}' and dh.subType='${subType}'
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and dh.type='${type}' and dh.sub_type='${subType}'
and dh.oper_time &gt;= '${MonthTime}-01 00:00:00'
and dh.oper_time &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_flag,'0') !='1'
</select>
<select id="getStockCheckSum" resultType="java.math.BigDecimal">
select ifnull(sum(di.BasicNumber),0) stockCheckSum from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId
select ifnull(sum(di.basic_number),0) stockCheckSum from jsh_depot_head dh
INNER JOIN jsh_depot_item di on dh.id=di.header_id
where 1=1
<if test="mId != null">
and di.MaterialId=#{mId}
and di.material_id=#{mId}
</if>
and dh.SubType='盘点复盘' and dh.`Status`='1'
and dh.sub_type='盘点复盘' and dh.`Status`='1'
<if test="depotId != null">
and di.DepotId=#{depotId}
and di.depot_id=#{depotId}
</if>
<if test="beginTime != null">
and dh.OperTime &gt;= '${beginTime}'
and dh.oper_time &gt;= '${beginTime}'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
</select>
<select id="getStockByParam" resultMap="StockMap">
select ifnull((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal),0) as in_stock,
ifnull((curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal),0) out_stock
from
(select sum(if(dh.type='入库' <if test="depotId != null">and di.DepotId=#{depotId}</if>, di.BasicNumber,0)) as inTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.AnotherDepotId=#{depotId}</if>,di.BasicNumber,0)) as transfInTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as transfOutTotal,
sum(if(dh.type='出库' and dh.SubType!='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as outTotal,
sum(if(dh.SubType='组装单' and di.MType='组合件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemInTotal,
sum(if(dh.SubType='组装单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemOutTotal,
sum(if(dh.SubType='拆卸单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemInTotal,
sum(if(dh.SubType='拆卸单' and di.MType='组合件' <if test="depotId != null"> and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemOutTotal
(select sum(if(dh.type='入库' <if test="depotId != null">and di.depot_id=#{depotId}</if>, di.basic_number,0)) as inTotal,
sum(if(dh.sub_type='调拨' <if test="depotId != null">and di.another_depot_id=#{depotId}</if>,di.basic_number,0)) as transfInTotal,
sum(if(dh.sub_type='调拨' <if test="depotId != null">and di.depot_id=#{depotId}</if>,di.basic_number,0)) as transfOutTotal,
sum(if(dh.type='出库' and dh.sub_type!='调拨' <if test="depotId != null">and di.depot_id=#{depotId}</if>,di.basic_number,0)) as outTotal,
sum(if(dh.sub_type='组装单' and di.material_type='组合件' <if test="depotId != null">and di.depot_id=#{depotId}</if>,di.basic_number,0)) as assemInTotal,
sum(if(dh.sub_type='组装单' and di.material_type='普通子件' <if test="depotId != null">and di.depot_id=#{depotId}</if>,di.basic_number,0)) as assemOutTotal,
sum(if(dh.sub_type='拆卸单' and di.material_type='普通子件' <if test="depotId != null">and di.depot_id=#{depotId}</if>,di.basic_number,0)) as disAssemInTotal,
sum(if(dh.sub_type='拆卸单' and di.material_type='组合件' <if test="depotId != null"> and di.depot_id=#{depotId}</if>,di.basic_number,0)) as disAssemOutTotal
from
jsh_depothead dh,jsh_depotitem di
jsh_depot_head dh,jsh_depot_item di
where 1=1
and dh.id=di.HeaderId
and di.MaterialId=#{mId}
and dh.id=di.header_id
and di.material_id=#{mId}
<if test="beginTime != null">
and dh.OperTime &gt;= '${beginTime}'
and dh.oper_time &gt;= '${beginTime}'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
and dh.oper_time &lt;= '${endTime}'
</if>
and dh.tenant_id=#{tenantId}
and di.tenant_id=#{tenantId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') as curep
and ifnull(dh.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1') as curep
</select>
<select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem">
select
dep.id,dep.headerId,dep.materialid,dep.munit,dep.opernumber,
dep.basicnumber,dep.unitprice,dep.taxunitprice,dep.allprice,dep.remark,
dep.img,dep.incidentals,dep.depotid,dep.anotherdepotid,dep.taxrate,
dep.taxmoney,dep.taxlastmoney,dep.otherfield1,dep.otherfield2,dep.otherfield3,
dep.otherfield4,dep.otherfield5,dep.mtype
from jsh_depotitem dep,jsh_material mat
dep.id,dep.header_id,dep.material_id,dep.materialUnit,dep.oper_number,
dep.basic_number,dep.unit_price,dep.tax_unit_price,dep.all_price,dep.remark,
dep.img,dep.incidentals,dep.depot_id,dep.another_depot_id,dep.tax_rate,
dep.tax_money,dep.tax_last_money,dep.other_field1,dep.other_field2,dep.other_field3,
dep.other_field4,dep.other_field5,dep.material_type
from jsh_depot_item dep,jsh_material mat
where 1=1
<if test="depotheadId != null">
and dep.HeaderId = #{depotheadId}
and dep.header_id = #{depotheadId}
</if>
and dep.materialid=mat.id
and dep.material_id=mat.id
<if test="enableSerialNumber != null">
and mat.enableSerialNumber = #{enableSerialNumber}
and mat.enable_serial_number = #{enableSerialNumber}
</if>
and ifnull(dep.delete_Flag,'0') !='1'
and ifnull(mat.delete_Flag,'0') !='1'
and ifnull(dep.delete_flag,'0') !='1'
and ifnull(mat.delete_flag,'0') !='1'
</select>
<delete id="deleteDepotItemByDepotHeadIds">
delete from jsh_depotitem
delete from jsh_depot_item
where 1=1
and HeaderId in
and header_id in
(
<foreach collection="depotheadIds" item="depotheadId" separator=",">
#{depotheadId}
@@ -311,10 +311,10 @@
</delete>
<update id="batchDeleteDepotItemByDepotHeadIds">
update jsh_depotitem
set delete_Flag='1'
update jsh_depot_item
set delete_flag='1'
where 1=1
and HeaderId in
and header_id in
(
<foreach collection="depotheadIds" item="depotheadId" separator=",">
#{depotheadId}
@@ -323,8 +323,8 @@
</update>
<update id="batchDeleteDepotItemByIds">
update jsh_depotitem
set delete_Flag='1'
update jsh_depot_item
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
@@ -336,90 +336,90 @@
<select id="getDepotItemListListByDepotIds" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.DepotItemMapper.Base_Column_List" />
from jsh_depotitem
from jsh_depot_item
where 1=1
and DepotId in (
and depot_id in (
<foreach collection="depotIds" item="depotId" separator=",">
#{depotId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDepotItemListListByMaterialIds" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.DepotItemMapper.Base_Column_List" />
from jsh_depotitem
from jsh_depot_item
where 1=1
and materialId in (
and material_id in (
<foreach collection="materialIds" item="materialId" separator=",">
#{materialId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
SELECT
m. NAME MaterialName,
m.Model MaterialModel,
m.name MaterialName,
m.model MaterialModel,
mc.`Name` categoryName,
CONCAT(
'(',
m.Standard,
m.standard,
')',
'(',
m.Color,
m.color,
')'
) AS MaterialOther,
m.unit MaterialUnit,
ifnull(m.safetystock,0) safetystock,
ifnull(m.safety_stock,0) safetystock,
IFNULL(intype.BasicInNumber ,0) BasicInNumber,
IFNULL(outtype.BasicOutNumber ,0) BasicOutNumber,
(
IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0)
) BasicNumber,
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0)) BasicLinjieNumber
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safety_stock,0)) BasicLinjieNumber
FROM
jsh_material m
LEFT JOIN jsh_material_category mc ON mc.Id = m.CategoryId
LEFT JOIN jsh_material_category mc ON mc.id = m.category_id
LEFT JOIN (
SELECT
di.MaterialId,
ifnull(sum(BasicNumber), 0) AS BasicInNumber
di.material_id,
ifnull(sum(basic_number), 0) AS BasicInNumber
FROM
jsh_depothead dh
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
AND ifnull(di.delete_Flag, '0') != '1'
jsh_depot_head dh
INNER JOIN jsh_depot_item di ON dh.id = di.header_id
AND ifnull(di.delete_flag, '0') != '1'
WHERE
dh.type = '入库'
<if test="pid != null">
and di.DepotId= ${pid}
and di.depot_id= ${pid}
</if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) intype ON intype.MaterialId = m.id
AND ifnull(dh.delete_flag, '0') != '1' group by di.material_id
) intype ON intype.material_id = m.id
LEFT JOIN (
SELECT
di.MaterialId,
ifnull(sum(BasicNumber), 0) AS BasicOutNumber
di.material_id,
ifnull(sum(basic_number), 0) AS BasicOutNumber
FROM
jsh_depothead dh
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
AND ifnull(di.delete_Flag, '0') != '1'
jsh_depot_head dh
INNER JOIN jsh_depot_item di ON dh.id = di.header_id
AND ifnull(di.delete_flag, '0') != '1'
WHERE
dh.type = '出库'
AND dh.SubType != '调拨'
AND dh.sub_type != '调拨'
<if test="pid != null">
and di.DepotId= ${pid}
and di.depot_id= ${pid}
</if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) outtype ON outtype.MaterialId = m.id
AND ifnull(dh.delete_flag, '0') != '1' group by di.material_id
) outtype ON outtype.material_id = m.id
WHERE
1 = 1
AND ifnull(m.delete_Flag, '0') != '1'
AND ifnull(m.delete_flag, '0') != '1'
AND intype.BasicInNumber > 0
ORDER BY
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0))
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safety_stock,0))
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -430,19 +430,19 @@
jsh_material m
LEFT JOIN (
SELECT
di.MaterialId,
ifnull(sum(BasicNumber), 0) AS BasicInNumber
di.material_id,
ifnull(sum(basic_number), 0) AS BasicInNumber
FROM
jsh_depothead dh
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
AND ifnull(di.delete_Flag, '0') != '1'
jsh_depot_head dh
INNER JOIN jsh_depot_item di ON dh.id = di.header_id
AND ifnull(di.delete_flag, '0') != '1'
WHERE
dh.type = '入库'
<if test="pid != null">
and di.DepotId= ${pid}
and di.depot_id= ${pid}
</if>
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
) intype ON intype.MaterialId = m.id
AND ifnull(dh.delete_flag, '0') != '1' group by di.material_id
) intype ON intype.material_id = m.id
WHERE
1 = 1

View File

@@ -2,24 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.MaterialMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Material">
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="CategoryId" jdbcType="BIGINT" property="categoryid" />
<result column="Name" jdbcType="VARCHAR" property="name" />
<result column="Mfrs" jdbcType="VARCHAR" property="mfrs" />
<result column="SafetyStock" jdbcType="DECIMAL" property="safetystock" />
<result column="Model" jdbcType="VARCHAR" property="model" />
<result column="Standard" jdbcType="VARCHAR" property="standard" />
<result column="Color" jdbcType="VARCHAR" property="color" />
<result column="Unit" jdbcType="VARCHAR" property="unit" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="UnitId" jdbcType="BIGINT" property="unitid" />
<result column="Enabled" jdbcType="BIT" property="enabled" />
<result column="OtherField1" jdbcType="VARCHAR" property="otherfield1" />
<result column="OtherField2" jdbcType="VARCHAR" property="otherfield2" />
<result column="OtherField3" jdbcType="VARCHAR" property="otherfield3" />
<result column="enableSerialNumber" jdbcType="VARCHAR" property="enableserialnumber" />
<id column="id" jdbcType="BIGINT" property="id" />
<result column="category_id" jdbcType="BIGINT" property="categoryId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="mfrs" jdbcType="VARCHAR" property="mfrs" />
<result column="safety_stock" jdbcType="DECIMAL" property="safetyStock" />
<result column="model" jdbcType="VARCHAR" property="model" />
<result column="standard" jdbcType="VARCHAR" property="standard" />
<result column="color" jdbcType="VARCHAR" property="color" />
<result column="unit" jdbcType="VARCHAR" property="unit" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="unit_id" jdbcType="BIGINT" property="unitId" />
<result column="enabled" jdbcType="BIT" property="enabled" />
<result column="other_field1" jdbcType="VARCHAR" property="otherField1" />
<result column="other_field2" jdbcType="VARCHAR" property="otherField2" />
<result column="other_field3" jdbcType="VARCHAR" property="otherField3" />
<result column="enable_serial_number" jdbcType="VARCHAR" property="enableSerialNumber" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -80,8 +80,9 @@
</where>
</sql>
<sql id="Base_Column_List">
Id, CategoryId, Name, Mfrs, SafetyStock, Model, Standard, Color, Unit, Remark, UnitId,
Enabled, OtherField1, OtherField2, OtherField3, enableSerialNumber, tenant_id, delete_Flag
id, category_id, name, mfrs, safety_stock, model, standard, color, unit, remark,
unit_id, enabled, other_field1, other_field2, other_field3, enable_serial_number,
tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="BaseResultMap">
select
@@ -101,11 +102,11 @@
select
<include refid="Base_Column_List" />
from jsh_material
where Id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_material
where Id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample">
delete from jsh_material
@@ -114,85 +115,85 @@
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Material">
insert into jsh_material (Id, CategoryId, Name,
Mfrs, SafetyStock, Model,
Standard, Color, Unit,
Remark, UnitId, Enabled,
OtherField1, OtherField2, OtherField3,
enableSerialNumber, tenant_id, delete_Flag
insert into jsh_material (id, category_id, name,
mfrs, safety_stock, model,
standard, color, unit,
remark, unit_id, enabled,
other_field1, other_field2, other_field3,
enable_serial_number, tenant_id, delete_flag
)
values (#{id,jdbcType=BIGINT}, #{categoryid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{mfrs,jdbcType=VARCHAR}, #{safetystock,jdbcType=DECIMAL}, #{model,jdbcType=VARCHAR},
values (#{id,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{mfrs,jdbcType=VARCHAR}, #{safetyStock,jdbcType=DECIMAL}, #{model,jdbcType=VARCHAR},
#{standard,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{unitid,jdbcType=BIGINT}, #{enabled,jdbcType=BIT},
#{otherfield1,jdbcType=VARCHAR}, #{otherfield2,jdbcType=VARCHAR}, #{otherfield3,jdbcType=VARCHAR},
#{enableserialnumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
#{remark,jdbcType=VARCHAR}, #{unitId,jdbcType=BIGINT}, #{enabled,jdbcType=BIT},
#{otherField1,jdbcType=VARCHAR}, #{otherField2,jdbcType=VARCHAR}, #{otherField3,jdbcType=VARCHAR},
#{enableSerialNumber,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Material">
insert into jsh_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
id,
</if>
<if test="categoryid != null">
CategoryId,
<if test="categoryId != null">
category_id,
</if>
<if test="name != null">
Name,
name,
</if>
<if test="mfrs != null">
Mfrs,
mfrs,
</if>
<if test="safetystock != null">
SafetyStock,
<if test="safetyStock != null">
safety_stock,
</if>
<if test="model != null">
Model,
model,
</if>
<if test="standard != null">
Standard,
standard,
</if>
<if test="color != null">
Color,
color,
</if>
<if test="unit != null">
Unit,
unit,
</if>
<if test="remark != null">
Remark,
remark,
</if>
<if test="unitid != null">
UnitId,
<if test="unitId != null">
unit_id,
</if>
<if test="enabled != null">
Enabled,
enabled,
</if>
<if test="otherfield1 != null">
OtherField1,
<if test="otherField1 != null">
other_field1,
</if>
<if test="otherfield2 != null">
OtherField2,
<if test="otherField2 != null">
other_field2,
</if>
<if test="otherfield3 != null">
OtherField3,
<if test="otherField3 != null">
other_field3,
</if>
<if test="enableserialnumber != null">
enableSerialNumber,
<if test="enableSerialNumber != null">
enable_serial_number,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="categoryid != null">
#{categoryid,jdbcType=BIGINT},
<if test="categoryId != null">
#{categoryId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
@@ -200,8 +201,8 @@
<if test="mfrs != null">
#{mfrs,jdbcType=VARCHAR},
</if>
<if test="safetystock != null">
#{safetystock,jdbcType=DECIMAL},
<if test="safetyStock != null">
#{safetyStock,jdbcType=DECIMAL},
</if>
<if test="model != null">
#{model,jdbcType=VARCHAR},
@@ -218,23 +219,23 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="unitid != null">
#{unitid,jdbcType=BIGINT},
<if test="unitId != null">
#{unitId,jdbcType=BIGINT},
</if>
<if test="enabled != null">
#{enabled,jdbcType=BIT},
</if>
<if test="otherfield1 != null">
#{otherfield1,jdbcType=VARCHAR},
<if test="otherField1 != null">
#{otherField1,jdbcType=VARCHAR},
</if>
<if test="otherfield2 != null">
#{otherfield2,jdbcType=VARCHAR},
<if test="otherField2 != null">
#{otherField2,jdbcType=VARCHAR},
</if>
<if test="otherfield3 != null">
#{otherfield3,jdbcType=VARCHAR},
<if test="otherField3 != null">
#{otherField3,jdbcType=VARCHAR},
</if>
<if test="enableserialnumber != null">
#{enableserialnumber,jdbcType=VARCHAR},
<if test="enableSerialNumber != null">
#{enableSerialNumber,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
@@ -254,58 +255,58 @@
update jsh_material
<set>
<if test="record.id != null">
Id = #{record.id,jdbcType=BIGINT},
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.categoryid != null">
CategoryId = #{record.categoryid,jdbcType=BIGINT},
<if test="record.categoryId != null">
category_id = #{record.categoryId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
Name = #{record.name,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.mfrs != null">
Mfrs = #{record.mfrs,jdbcType=VARCHAR},
mfrs = #{record.mfrs,jdbcType=VARCHAR},
</if>
<if test="record.safetystock != null">
SafetyStock = #{record.safetystock,jdbcType=DECIMAL},
<if test="record.safetyStock != null">
safety_stock = #{record.safetyStock,jdbcType=DECIMAL},
</if>
<if test="record.model != null">
Model = #{record.model,jdbcType=VARCHAR},
model = #{record.model,jdbcType=VARCHAR},
</if>
<if test="record.standard != null">
Standard = #{record.standard,jdbcType=VARCHAR},
standard = #{record.standard,jdbcType=VARCHAR},
</if>
<if test="record.color != null">
Color = #{record.color,jdbcType=VARCHAR},
color = #{record.color,jdbcType=VARCHAR},
</if>
<if test="record.unit != null">
Unit = #{record.unit,jdbcType=VARCHAR},
unit = #{record.unit,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
Remark = #{record.remark,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.unitid != null">
UnitId = #{record.unitid,jdbcType=BIGINT},
<if test="record.unitId != null">
unit_id = #{record.unitId,jdbcType=BIGINT},
</if>
<if test="record.enabled != null">
Enabled = #{record.enabled,jdbcType=BIT},
enabled = #{record.enabled,jdbcType=BIT},
</if>
<if test="record.otherfield1 != null">
OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
<if test="record.otherField1 != null">
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
</if>
<if test="record.otherfield2 != null">
OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
<if test="record.otherField2 != null">
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
</if>
<if test="record.otherfield3 != null">
OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
<if test="record.otherField3 != null">
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
</if>
<if test="record.enableserialnumber != null">
enableSerialNumber = #{record.enableserialnumber,jdbcType=VARCHAR},
<if test="record.enableSerialNumber != null">
enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@@ -314,24 +315,24 @@
</update>
<update id="updateByExample" parameterType="map">
update jsh_material
set Id = #{record.id,jdbcType=BIGINT},
CategoryId = #{record.categoryid,jdbcType=BIGINT},
Name = #{record.name,jdbcType=VARCHAR},
Mfrs = #{record.mfrs,jdbcType=VARCHAR},
SafetyStock = #{record.safetystock,jdbcType=DECIMAL},
Model = #{record.model,jdbcType=VARCHAR},
Standard = #{record.standard,jdbcType=VARCHAR},
Color = #{record.color,jdbcType=VARCHAR},
Unit = #{record.unit,jdbcType=VARCHAR},
Remark = #{record.remark,jdbcType=VARCHAR},
UnitId = #{record.unitid,jdbcType=BIGINT},
Enabled = #{record.enabled,jdbcType=BIT},
OtherField1 = #{record.otherfield1,jdbcType=VARCHAR},
OtherField2 = #{record.otherfield2,jdbcType=VARCHAR},
OtherField3 = #{record.otherfield3,jdbcType=VARCHAR},
enableSerialNumber = #{record.enableserialnumber,jdbcType=VARCHAR},
set id = #{record.id,jdbcType=BIGINT},
category_id = #{record.categoryId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
mfrs = #{record.mfrs,jdbcType=VARCHAR},
safety_stock = #{record.safetyStock,jdbcType=DECIMAL},
model = #{record.model,jdbcType=VARCHAR},
standard = #{record.standard,jdbcType=VARCHAR},
color = #{record.color,jdbcType=VARCHAR},
unit = #{record.unit,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
unit_id = #{record.unitId,jdbcType=BIGINT},
enabled = #{record.enabled,jdbcType=BIT},
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
enable_serial_number = #{record.enableSerialNumber,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -339,79 +340,79 @@
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Material">
update jsh_material
<set>
<if test="categoryid != null">
CategoryId = #{categoryid,jdbcType=BIGINT},
<if test="categoryId != null">
category_id = #{categoryId,jdbcType=BIGINT},
</if>
<if test="name != null">
Name = #{name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
</if>
<if test="mfrs != null">
Mfrs = #{mfrs,jdbcType=VARCHAR},
mfrs = #{mfrs,jdbcType=VARCHAR},
</if>
<if test="safetystock != null">
SafetyStock = #{safetystock,jdbcType=DECIMAL},
<if test="safetyStock != null">
safety_stock = #{safetyStock,jdbcType=DECIMAL},
</if>
<if test="model != null">
Model = #{model,jdbcType=VARCHAR},
model = #{model,jdbcType=VARCHAR},
</if>
<if test="standard != null">
Standard = #{standard,jdbcType=VARCHAR},
standard = #{standard,jdbcType=VARCHAR},
</if>
<if test="color != null">
Color = #{color,jdbcType=VARCHAR},
color = #{color,jdbcType=VARCHAR},
</if>
<if test="unit != null">
Unit = #{unit,jdbcType=VARCHAR},
unit = #{unit,jdbcType=VARCHAR},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="unitid != null">
UnitId = #{unitid,jdbcType=BIGINT},
<if test="unitId != null">
unit_id = #{unitId,jdbcType=BIGINT},
</if>
<if test="enabled != null">
Enabled = #{enabled,jdbcType=BIT},
enabled = #{enabled,jdbcType=BIT},
</if>
<if test="otherfield1 != null">
OtherField1 = #{otherfield1,jdbcType=VARCHAR},
<if test="otherField1 != null">
other_field1 = #{otherField1,jdbcType=VARCHAR},
</if>
<if test="otherfield2 != null">
OtherField2 = #{otherfield2,jdbcType=VARCHAR},
<if test="otherField2 != null">
other_field2 = #{otherField2,jdbcType=VARCHAR},
</if>
<if test="otherfield3 != null">
OtherField3 = #{otherfield3,jdbcType=VARCHAR},
<if test="otherField3 != null">
other_field3 = #{otherField3,jdbcType=VARCHAR},
</if>
<if test="enableserialnumber != null">
enableSerialNumber = #{enableserialnumber,jdbcType=VARCHAR},
<if test="enableSerialNumber != null">
enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Material">
update jsh_material
set CategoryId = #{categoryid,jdbcType=BIGINT},
Name = #{name,jdbcType=VARCHAR},
Mfrs = #{mfrs,jdbcType=VARCHAR},
SafetyStock = #{safetystock,jdbcType=DECIMAL},
Model = #{model,jdbcType=VARCHAR},
Standard = #{standard,jdbcType=VARCHAR},
Color = #{color,jdbcType=VARCHAR},
Unit = #{unit,jdbcType=VARCHAR},
Remark = #{remark,jdbcType=VARCHAR},
UnitId = #{unitid,jdbcType=BIGINT},
Enabled = #{enabled,jdbcType=BIT},
OtherField1 = #{otherfield1,jdbcType=VARCHAR},
OtherField2 = #{otherfield2,jdbcType=VARCHAR},
OtherField3 = #{otherfield3,jdbcType=VARCHAR},
enableSerialNumber = #{enableserialnumber,jdbcType=VARCHAR},
set category_id = #{categoryId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
mfrs = #{mfrs,jdbcType=VARCHAR},
safety_stock = #{safetyStock,jdbcType=DECIMAL},
model = #{model,jdbcType=VARCHAR},
standard = #{standard,jdbcType=VARCHAR},
color = #{color,jdbcType=VARCHAR},
unit = #{unit,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
unit_id = #{unitId,jdbcType=BIGINT},
enabled = #{enabled,jdbcType=BIT},
other_field1 = #{otherField1,jdbcType=VARCHAR},
other_field2 = #{otherField2,jdbcType=VARCHAR},
other_field3 = #{otherField3,jdbcType=VARCHAR},
enable_serial_number = #{enableSerialNumber,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -21,8 +21,8 @@
me.purchase_decimal, me.commodity_decimal, me.wholesale_decimal,me.low_decimal
FROM jsh_material m
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.status,'0') !='2'
where 1=1
and me.default_flag=1
<if test="barCode != null">
@@ -32,15 +32,15 @@
and m.name like '%${name}%'
</if>
<if test="standard != null">
and m.Standard like '%${standard}%'
and m.standard like '%${standard}%'
</if>
<if test="model != null">
and m.model like '%${model}%'
</if>
<if test="categoryIds != null">
and m.CategoryId in (${categoryIds})
and m.category_id in (${categoryIds})
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
order by m.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -52,8 +52,8 @@
COUNT(m.id)
FROM jsh_material m
left JOIN jsh_material_extend me on m.id = me.material_id and ifnull(me.delete_Flag,'0') !='1'
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.status,'0') !='2'
WHERE 1=1
and me.default_flag=1
<if test="barCode != null">
@@ -63,29 +63,29 @@
and m.name like '%${name}%'
</if>
<if test="standard != null">
and m.Standard like '%${standard}%'
and m.standard like '%${standard}%'
</if>
<if test="model != null">
and m.model like '%${model}%'
</if>
<if test="categoryIds != null">
and m.CategoryId in (${categoryIds})
and m.category_id in (${categoryIds})
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="findUnitName" resultType="java.lang.String">
select u.name from jsh_unit u
left join jsh_material m on m.UnitId=u.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material m on m.unit_id=u.id and ifnull(m.delete_flag,'0') !='1'
where m.id = ${mId}
and ifnull(u.delete_Flag,'0') !='1'
and ifnull(u.delete_flag,'0') !='1'
</select>
<select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_flag,'0') !='1'
where m.id = ${id}
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="findByIdWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
@@ -93,21 +93,21 @@
me.wholesale_decimal, me.low_decimal
from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where me.id = ${meId}
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="findBySelectWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
select m.*,u.name unit_name,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1 and me.id is not null
<if test="q != null">
and (m.name like '%${q}%' or me.bar_code like '%${q}%')
</if>
and ifnull(m.delete_Flag,'0') !='1'
ORDER BY Id desc
and ifnull(m.delete_flag,'0') !='1'
ORDER BY id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -116,12 +116,12 @@
<select id="findBySelectWithBarCodeCount" resultType="java.lang.Integer">
select count(1) from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1 and me.id is not null
<if test="q != null">
and (m.name like '%${q}%' or me.bar_code like '%${q}%')
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
@@ -129,8 +129,8 @@
me.wholesale_decimal, me.low_decimal
FROM jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_Flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.status,'0') !='2'
where 1=1
and me.default_flag=1
<if test="name != null">
@@ -140,9 +140,9 @@
and m.model like '%${model}%'
</if>
<if test="categoryIds != null">
and m.CategoryId in (${categoryIds})
and m.category_id in (${categoryIds})
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
order by m.id desc
</select>
<select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material">
@@ -152,18 +152,17 @@
<if test="name != null">
and m.name =#{name}
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="getMaterialEnableSerialNumberList" parameterType="java.util.Map" resultMap="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap">
select
Id, CategoryId, name, Mfrs, SafetyStock, Model, Standard, Color, Unit, Remark,
UnitId, Enabled,enableSerialNumber
id, category_id, name, mfrs, safety_stock, model, standard, color, unit, remark,
unit_id, enabled,enable_serial_number
FROM jsh_material
where 1=1
and enabled ='1'
and enableSerialNumber ='1'
and enable_serial_number ='1'
<if test="name != null and name != ''">
<bind name="name" value="'%' + _parameter.name + '%'" />
and name like #{name}
@@ -172,7 +171,7 @@
<bind name="model" value="'%' + _parameter.model + '%'" />
and model like #{model}
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
order by id desc
</select>
@@ -181,7 +180,7 @@
FROM jsh_material
where 1=1
and enabled ='1'
and enableSerialNumber ='1'
and enable_serial_number ='1'
<if test="name != null and name != ''">
<bind name="name" value="'%' + _parameter.name + '%'" />
and name like #{name}
@@ -190,14 +189,14 @@
<bind name="model" value="'%' + _parameter.model + '%'" />
and model like #{model}
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteMaterialByIds">
update jsh_material
set delete_Flag='1'
set delete_flag='1'
where 1=1
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
@@ -209,24 +208,24 @@
<include refid="com.jsh.erp.datasource.mappers.MaterialMapper.Base_Column_List" />
from jsh_material
where 1=1
and categoryId in (
and category_id in (
<foreach collection="categoryIds" item="categoryId" separator=",">
#{categoryId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getMaterialListByUnitIds" resultMap="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap">
select
<include refid="com.jsh.erp.datasource.mappers.MaterialMapper.Base_Column_List" />
from jsh_material
where 1=1
and unitId in (
and unit_id in (
<foreach collection="unitIds" item="unitId" separator=",">
#{unitId}
</foreach>
)
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getMaxBarCode" resultType="java.lang.String">
@@ -239,18 +238,18 @@
select m.*,me.bar_code m_bar_code,u.name unitName, mc.name categoryName
FROM jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_flag,'0') !='1'
left JOIN jsh_material_category mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_flag,'0') !='1'
left JOIN jsh_material_category mc on m.category_id = mc.id and ifnull(mc.status,'0') !='2'
where 1=1
<if test="meId != null">
and me.id = ${meId}
</if>
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_flag,'0') !='1'
</select>
<select id="getMaterialNameList" resultType="java.lang.String">
select m.name from jsh_material m
where m.name is not null and m.name !='' and ifnull(m.delete_Flag,'0') !='1'
where m.name is not null and m.name !='' and ifnull(m.delete_flag,'0') !='1'
group by m.name
order by m.name asc
</select>

View File

@@ -13,10 +13,10 @@
select
ser.id, ser.material_id, ser.serial_number, ser.is_sell, ser.remark, ser.delete_flag, ser.create_time,
ser.update_time,mat.name as materialName,null as creator,null as updater,null as creatorName,
null as updaterName,ser.depot_head_id, dh.number as depotHeadNumber,concat(dh.SubType,dh.Type) as depotHeadType
null as updaterName,ser.depot_head_id, dh.number as depotHeadNumber,concat(dh.sub_type,dh.type) as depotHeadType
FROM jsh_serial_number ser
left join jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_Flag,'0') !='1'
left join jsh_depothead dh on dh.id= ser.depot_head_id and ifnull(dh.delete_Flag,'0') !='1'
left join jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_flag,'0') !='1'
left join jsh_depot_head dh on dh.id= ser.depot_head_id and ifnull(dh.delete_flag,'0') !='1'
where 1=1
<if test="serialNumber != null">
<bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" />

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@
and type='${type}'
</if>
<if test="phonenum != null">
and phonenum like '%${phonenum}%'
and phone_num like '%${phonenum}%'
</if>
<if test="telephone != null">
and telephone like '%${telephone}%'
@@ -20,7 +20,7 @@
<if test="description != null">
and description like '%${description}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
order by id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -38,7 +38,7 @@
and type='${type}'
</if>
<if test="phonenum != null">
and phonenum like '%${phonenum}%'
and phone_num like '%${phonenum}%'
</if>
<if test="telephone != null">
and telephone like '%${telephone}%'
@@ -46,7 +46,7 @@
<if test="description != null">
and description like '%${description}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">
@@ -60,7 +60,7 @@
and type='${type}'
</if>
<if test="phonenum != null">
and phonenum like '%${phonenum}%'
and phone_num like '%${phonenum}%'
</if>
<if test="telephone != null">
and telephone like '%${telephone}%'
@@ -68,11 +68,11 @@
<if test="description != null">
and description like '%${description}%'
</if>
and ifnull(delete_Flag,'0') !='1'
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteSupplierByIds">
update jsh_supplier
set delete_Flag='1'
set delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">