vue版本上线
This commit is contained in:
338
jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml
Normal file
338
jshERP-boot/src/main/resources/mapper_xml/AccountHeadMapper.xml
Normal file
@@ -0,0 +1,338 @@
|
||||
<?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">
|
||||
<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="creator" jdbcType="BIGINT" property="creator" />
|
||||
<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, creator, 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, creator, 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}, #{creator,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="creator != null">
|
||||
creator,
|
||||
</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="creator != null">
|
||||
#{creator,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.creator != null">
|
||||
creator = #{record.creator,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},
|
||||
creator = #{record.creator,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="creator != null">
|
||||
creator = #{creator,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},
|
||||
creator = #{creator,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>
|
||||
@@ -0,0 +1,139 @@
|
||||
<?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.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="userName" jdbcType="VARCHAR" property="userName" />
|
||||
<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, u.username userName, a.Name AccountName
|
||||
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_user u on ah.creator=u.id and ifnull(u.Status,'0') ='0'
|
||||
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.bill_no like '%${billNo}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and ah.type='${type}'
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and ah.bill_time >= '${beginTime} 00:00:00'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and ah.bill_time <= '${endTime} 23:59:59'
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and ah.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
order by ah.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countsByAccountHead" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_account_head
|
||||
WHERE 1=1
|
||||
<if test="billNo != null">
|
||||
and bill_no like '%${billNo}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and bill_time >= '${beginTime} 00:00:00'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and bill_time <= '${endTime} 23:59:59'
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAllMoney" resultType="java.math.BigDecimal">
|
||||
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_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.bill_no = '${billNo}'
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteAccountHeadByIds">
|
||||
update jsh_account_head
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<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_account_head
|
||||
where 1=1
|
||||
and account_id in (
|
||||
<foreach collection="accountIds" item="accountId" separator=",">
|
||||
#{accountId}
|
||||
</foreach>
|
||||
)
|
||||
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_account_head
|
||||
where 1=1
|
||||
and organ_id in (
|
||||
<foreach collection="organIds" item="organId" separator=",">
|
||||
#{organId}
|
||||
</foreach>
|
||||
)
|
||||
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_account_head
|
||||
where 1=1
|
||||
and hands_person_id in (
|
||||
<foreach collection="handsPersonIds" item="handsPersonId" separator=",">
|
||||
#{handsPersonId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
</mapper>
|
||||
258
jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml
Normal file
258
jshERP-boot/src/main/resources/mapper_xml/AccountItemMapper.xml
Normal file
@@ -0,0 +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">
|
||||
<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>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?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.AccountItemMapperEx">
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap" id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.AccountItemVo4List">
|
||||
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
|
||||
<result column="InOutItemName" jdbcType="VARCHAR" property="inOutItemName" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionAccountItem" parameterType="com.jsh.erp.datasource.entities.AccountItemExample" resultMap="com.jsh.erp.datasource.mappers.AccountItemMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_account_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByAccountItem" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_account_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
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_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_account_item
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<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_account_item
|
||||
where 1=1
|
||||
and account_id in (
|
||||
<foreach collection="accountIds" item="accountId" separator=",">
|
||||
#{accountId}
|
||||
</foreach>
|
||||
)
|
||||
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_account_item
|
||||
where 1=1
|
||||
and header_id in (
|
||||
<foreach collection="headerIds" item="headerId" separator=",">
|
||||
#{headerId}
|
||||
</foreach>
|
||||
)
|
||||
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_account_item
|
||||
where 1=1
|
||||
and in_out_item_id in (
|
||||
<foreach collection="inOutItemIds" item="inOutItemId" separator=",">
|
||||
#{inOutItemId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteAccountItemByHeadIds">
|
||||
update jsh_account_item
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and header_id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
276
jshERP-boot/src/main/resources/mapper_xml/AccountMapper.xml
Normal file
276
jshERP-boot/src/main/resources/mapper_xml/AccountMapper.xml
Normal file
@@ -0,0 +1,276 @@
|
||||
<?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.AccountMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Account">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="serial_no" jdbcType="VARCHAR" property="serialNo" />
|
||||
<result column="initial_amount" jdbcType="DECIMAL" property="initialAmount" />
|
||||
<result column="current_amount" jdbcType="DECIMAL" property="currentAmount" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="is_default" jdbcType="BIT" property="isDefault" />
|
||||
<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, name, serial_no, initial_amount, current_amount, remark, is_default, tenant_id,
|
||||
delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_account
|
||||
<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
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_account
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AccountExample">
|
||||
delete from jsh_account
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Account">
|
||||
insert into jsh_account (id, name, serial_no,
|
||||
initial_amount, current_amount, remark,
|
||||
is_default, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
|
||||
#{initialAmount,jdbcType=DECIMAL}, #{currentAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
|
||||
#{isDefault,jdbcType=BIT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Account">
|
||||
insert into jsh_account
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
serial_no,
|
||||
</if>
|
||||
<if test="initialAmount != null">
|
||||
initial_amount,
|
||||
</if>
|
||||
<if test="currentAmount != null">
|
||||
current_amount,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
is_default,
|
||||
</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="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
#{serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="initialAmount != null">
|
||||
#{initialAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="currentAmount != null">
|
||||
#{currentAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
#{isDefault,jdbcType=BIT},
|
||||
</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.AccountExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_account
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_account
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.serialNo != null">
|
||||
serial_no = #{record.serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.initialAmount != null">
|
||||
initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.currentAmount != null">
|
||||
current_amount = #{record.currentAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isDefault != null">
|
||||
is_default = #{record.isDefault,jdbcType=BIT},
|
||||
</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
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
serial_no = #{record.serialNo,jdbcType=VARCHAR},
|
||||
initial_amount = #{record.initialAmount,jdbcType=DECIMAL},
|
||||
current_amount = #{record.currentAmount,jdbcType=DECIMAL},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
is_default = #{record.isDefault,jdbcType=BIT},
|
||||
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.Account">
|
||||
update jsh_account
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
serial_no = #{serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="initialAmount != null">
|
||||
initial_amount = #{initialAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="currentAmount != null">
|
||||
current_amount = #{currentAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
is_default = #{isDefault,jdbcType=BIT},
|
||||
</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.Account">
|
||||
update jsh_account
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
serial_no = #{serialNo,jdbcType=VARCHAR},
|
||||
initial_amount = #{initialAmount,jdbcType=DECIMAL},
|
||||
current_amount = #{currentAmount,jdbcType=DECIMAL},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
is_default = #{isDefault,jdbcType=BIT},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
201
jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml
Normal file
201
jshERP-boot/src/main/resources/mapper_xml/AccountMapperEx.xml
Normal file
@@ -0,0 +1,201 @@
|
||||
<?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.AccountMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.AccountMapper.BaseResultMap" id="ResultListMap" type="com.jsh.erp.datasource.vo.AccountVo4List">
|
||||
<result column="thisMonthAmount" jdbcType="VARCHAR" property="thisMonthAmount" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultInOutList" type="com.jsh.erp.datasource.vo.AccountVo4InOutList">
|
||||
<result column="Number" jdbcType="VARCHAR" property="number" />
|
||||
<result column="newType" jdbcType="VARCHAR" property="type" />
|
||||
<result column="supplier" jdbcType="VARCHAR" property="supplierName" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getAccountByParam" resultType="com.jsh.erp.datasource.entities.Account">
|
||||
select *
|
||||
FROM jsh_account
|
||||
where 1=1
|
||||
<if test="name != null and name !=''">
|
||||
<bind name="bindName" value="'%'+name+'%'"/>
|
||||
and name like #{bindName}
|
||||
</if>
|
||||
<if test="serialNo != null and serialNo !=''">
|
||||
<bind name="bindSerialNo" value="'%'+serialNo+'%'"/>
|
||||
and serial_no like #{bindSerialNo}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByConditionAccount" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultListMap">
|
||||
select *
|
||||
FROM jsh_account
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
and serial_no like '%${serialNo}%'
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countsByAccount" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_account
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
and serial_no like '%${serialNo}%'
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAccountInOutList" parameterType="com.jsh.erp.datasource.entities.AccountExample" resultMap="ResultInOutList">
|
||||
<!--主表出入库涉及的账户 -->
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
|
||||
<!--主表收入和支出涉及的账户 -->
|
||||
UNION ALL
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||
UNION ALL
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--主表中转出的账户 -->
|
||||
UNION ALL
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中被转入的账户 -->
|
||||
UNION ALL
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--多账户的情况 -->
|
||||
UNION ALL
|
||||
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.account_id_list like '%${accountId}%'
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
ORDER BY oTime desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findAccountInOutListCount" resultType="java.lang.Integer">
|
||||
select sum(a) from
|
||||
(
|
||||
<!--主表出入库涉及的账户 -->
|
||||
select count(1) a
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
<!--主表收入和支出涉及的账户 -->
|
||||
UNION ALL
|
||||
select count(1) a
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中涉及的账户(收款,付款,收预付款) -->
|
||||
UNION ALL
|
||||
select count(1) a
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--主表中转出的账户 -->
|
||||
UNION ALL
|
||||
select count(1) a
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--明细中被转入的账户 -->
|
||||
UNION ALL
|
||||
select count(1) a
|
||||
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.account_id=${accountId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
<!--多账户的情况 -->
|
||||
UNION ALL
|
||||
select count(1) a
|
||||
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.account_id_list like '%${accountId}%'
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
) cc
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteAccountByIds">
|
||||
update jsh_account
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
608
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapper.xml
Normal file
608
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapper.xml
Normal file
@@ -0,0 +1,608 @@
|
||||
<?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.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="sub_type" jdbcType="VARCHAR" property="subType" />
|
||||
<result column="default_number" jdbcType="VARCHAR" property="defaultNumber" />
|
||||
<result column="number" jdbcType="VARCHAR" property="number" />
|
||||
<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="creator" jdbcType="BIGINT" property="creator" />
|
||||
<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="bill_type" jdbcType="VARCHAR" property="billType" />
|
||||
<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" />
|
||||
</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, sub_type, default_number, number, create_time, oper_time, organ_id, hands_person_id,
|
||||
creator, account_id, change_amount, total_price, pay_type, bill_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
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_depot_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_depot_head
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_depot_head
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample">
|
||||
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_depot_head (id, type, sub_type,
|
||||
default_number, number, create_time,
|
||||
oper_time, organ_id, hands_person_id,
|
||||
creator, account_id, change_amount,
|
||||
total_price, pay_type, bill_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}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{operTime,jdbcType=TIMESTAMP}, #{organId,jdbcType=BIGINT}, #{handsPersonId,jdbcType=BIGINT},
|
||||
#{creator,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{changeAmount,jdbcType=DECIMAL},
|
||||
#{totalPrice,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, #{billType,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_depot_head
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
sub_type,
|
||||
</if>
|
||||
<if test="defaultNumber != null">
|
||||
default_number,
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="operTime != null">
|
||||
oper_time,
|
||||
</if>
|
||||
<if test="organId != null">
|
||||
organ_id,
|
||||
</if>
|
||||
<if test="handsPersonId != null">
|
||||
hands_person_id,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="accountId != null">
|
||||
account_id,
|
||||
</if>
|
||||
<if test="changeAmount != null">
|
||||
change_amount,
|
||||
</if>
|
||||
<if test="totalPrice != null">
|
||||
total_price,
|
||||
</if>
|
||||
<if test="payType != null">
|
||||
pay_type,
|
||||
</if>
|
||||
<if test="billType != null">
|
||||
bill_type,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="salesMan != null">
|
||||
sales_man,
|
||||
</if>
|
||||
<if test="accountIdList != null">
|
||||
account_id_list,
|
||||
</if>
|
||||
<if test="accountMoneyList != null">
|
||||
account_money_list,
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
discount,
|
||||
</if>
|
||||
<if test="discountMoney != null">
|
||||
discount_money,
|
||||
</if>
|
||||
<if test="discountLastMoney != null">
|
||||
discount_last_money,
|
||||
</if>
|
||||
<if test="otherMoney != null">
|
||||
other_money,
|
||||
</if>
|
||||
<if test="otherMoneyList != null">
|
||||
other_money_list,
|
||||
</if>
|
||||
<if test="otherMoneyItem != null">
|
||||
other_money_item,
|
||||
</if>
|
||||
<if test="accountDay != null">
|
||||
account_day,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="linkNumber != null">
|
||||
link_number,
|
||||
</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="subType != null">
|
||||
#{subType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultNumber != null">
|
||||
#{defaultNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
#{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="operTime != null">
|
||||
#{operTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="organId != null">
|
||||
#{organId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="handsPersonId != null">
|
||||
#{handsPersonId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="accountId != null">
|
||||
#{accountId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="changeAmount != null">
|
||||
#{changeAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalPrice != null">
|
||||
#{totalPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="payType != null">
|
||||
#{payType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="billType != null">
|
||||
#{billType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="salesMan != null">
|
||||
#{salesMan,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountIdList != null">
|
||||
#{accountIdList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountMoneyList != null">
|
||||
#{accountMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
#{discount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="discountMoney != null">
|
||||
#{discountMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="discountLastMoney != null">
|
||||
#{discountLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherMoney != null">
|
||||
#{otherMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherMoneyList != null">
|
||||
#{otherMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherMoneyItem != null">
|
||||
#{otherMoneyItem,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountDay != null">
|
||||
#{accountDay,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="linkNumber != null">
|
||||
#{linkNumber,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.DepotHeadExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_depot_head
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_depot_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.subType != null">
|
||||
sub_type = #{record.subType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.defaultNumber != null">
|
||||
default_number = #{record.defaultNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.number != null">
|
||||
number = #{record.number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.operTime != null">
|
||||
oper_time = #{record.operTime,jdbcType=TIMESTAMP},
|
||||
</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.creator != null">
|
||||
creator = #{record.creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.accountId != null">
|
||||
account_id = #{record.accountId,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.payType != null">
|
||||
pay_type = #{record.payType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.billType != null">
|
||||
bill_type = #{record.billType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.salesMan != null">
|
||||
sales_man = #{record.salesMan,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.accountIdList != null">
|
||||
account_id_list = #{record.accountIdList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.accountMoneyList != null">
|
||||
account_money_list = #{record.accountMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.discount != null">
|
||||
discount = #{record.discount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.discountMoney != null">
|
||||
discount_money = #{record.discountMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.discountLastMoney != null">
|
||||
discount_last_money = #{record.discountLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.otherMoney != null">
|
||||
other_money = #{record.otherMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.otherMoneyList != null">
|
||||
other_money_list = #{record.otherMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherMoneyItem != null">
|
||||
other_money_item = #{record.otherMoneyItem,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.accountDay != null">
|
||||
account_day = #{record.accountDay,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
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},
|
||||
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},
|
||||
creator = #{record.creator,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},
|
||||
bill_type = #{record.billType,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}
|
||||
<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_depot_head
|
||||
<set>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
sub_type = #{subType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultNumber != null">
|
||||
default_number = #{defaultNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number = #{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="operTime != null">
|
||||
oper_time = #{operTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="organId != null">
|
||||
organ_id = #{organId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="handsPersonId != null">
|
||||
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="accountId != null">
|
||||
account_id = #{accountId,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="payType != null">
|
||||
pay_type = #{payType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="billType != null">
|
||||
bill_type = #{billType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="salesMan != null">
|
||||
sales_man = #{salesMan,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountIdList != null">
|
||||
account_id_list = #{accountIdList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountMoneyList != null">
|
||||
account_money_list = #{accountMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="discount != null">
|
||||
discount = #{discount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="discountMoney != null">
|
||||
discount_money = #{discountMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="discountLastMoney != null">
|
||||
discount_last_money = #{discountLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherMoney != null">
|
||||
other_money = #{otherMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherMoneyList != null">
|
||||
other_money_list = #{otherMoneyList,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherMoneyItem != null">
|
||||
other_money_item = #{otherMoneyItem,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountDay != null">
|
||||
account_day = #{accountDay,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotHead">
|
||||
update jsh_depot_head
|
||||
set type = #{type,jdbcType=VARCHAR},
|
||||
sub_type = #{subType,jdbcType=VARCHAR},
|
||||
default_number = #{defaultNumber,jdbcType=VARCHAR},
|
||||
number = #{number,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
oper_time = #{operTime,jdbcType=TIMESTAMP},
|
||||
organ_id = #{organId,jdbcType=BIGINT},
|
||||
hands_person_id = #{handsPersonId,jdbcType=BIGINT},
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
account_id = #{accountId,jdbcType=BIGINT},
|
||||
change_amount = #{changeAmount,jdbcType=DECIMAL},
|
||||
total_price = #{totalPrice,jdbcType=DECIMAL},
|
||||
pay_type = #{payType,jdbcType=VARCHAR},
|
||||
bill_type = #{billType,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}
|
||||
</update>
|
||||
</mapper>
|
||||
441
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml
Normal file
441
jshERP-boot/src/main/resources/mapper_xml/DepotHeadMapperEx.xml
Normal file
@@ -0,0 +1,441 @@
|
||||
<?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.DepotHeadMapperEx">
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.vo.DepotHeadVo4List">
|
||||
<result column="OrganName" jdbcType="VARCHAR" property="organName" />
|
||||
<result column="userName" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.DepotHeadVo4InDetail">
|
||||
<result column="Number" jdbcType="VARCHAR" property="Number" />
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="Model" jdbcType="VARCHAR" property="Model" />
|
||||
<result column="standard" jdbcType="VARCHAR" property="standard" />
|
||||
<result column="unit_price" jdbcType="DECIMAL" property="UnitPrice" />
|
||||
<result column="oper_number" jdbcType="DECIMAL" property="OperNumber" />
|
||||
<result column="all_price" jdbcType="DECIMAL" property="AllPrice" />
|
||||
<result column="SName" jdbcType="VARCHAR" property="SName" />
|
||||
<result column="DName" jdbcType="VARCHAR" property="DName" />
|
||||
<result column="OperTime" jdbcType="VARCHAR" property="OperTime" />
|
||||
<result column="NewType" jdbcType="VARCHAR" property="NewType" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultInOutMaterialCount" type="com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount">
|
||||
<result column="MaterialId" jdbcType="BIGINT" property="MaterialId" />
|
||||
<result column="mName" jdbcType="VARCHAR" property="mName" />
|
||||
<result column="Model" jdbcType="VARCHAR" property="Model" />
|
||||
<result column="standard" jdbcType="VARCHAR" property="standard" />
|
||||
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
|
||||
<result column="numSum" jdbcType="DECIMAL" property="numSum" />
|
||||
<result column="priceSum" jdbcType="DECIMAL" property="priceSum" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultStatementAccount" type="com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount">
|
||||
<result column="number" jdbcType="VARCHAR" property="number" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<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, u.username userName, a.name AccountName
|
||||
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_user u on dh.creator=u.id and ifnull(u.Status,'0') ='0'
|
||||
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}'
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type='${subType}'
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and dh.status ='${status}'
|
||||
</if>
|
||||
<if test="number != null">
|
||||
and dh.number like '%${number}%'
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime} 00:00:00'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime} 23:59:59'
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotIds != null">
|
||||
and di.depot_id in (${depotIds})
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
order by dh.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByDepotHead" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1) from
|
||||
(select distinct dh.* FROM jsh_depot_head dh
|
||||
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}'
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and dh.sub_type='${subType}'
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and dh.status ='${status}'
|
||||
</if>
|
||||
<if test="number != null">
|
||||
and dh.number like '%${number}%'
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime} 00:00:00'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime} 23:59:59'
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotIds != null">
|
||||
and di.depot_id in (${depotIds})
|
||||
</if>
|
||||
<if test="creatorArray != null">
|
||||
and dh.creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
and ifnull(dh.delete_Flag,'0') !='1') tb
|
||||
</select>
|
||||
|
||||
<select id="findMaterialsListByHeaderId" resultType="java.lang.String">
|
||||
select group_concat(concat(jsh_material.name,' ',jsh_material.standard,' ',jsh_material.model)) as mName
|
||||
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,m.standard,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} 00:00:00' and dh.oper_time <='${endTime} 23:59:59'
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
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>
|
||||
</select>
|
||||
|
||||
<select id="findByAllCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
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} 00:00:00' and dh.oper_time <='${endTime} 23:59:59'
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dh.type='${type}'
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
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.material_id, m.mName,m.Model,m.standard,m.categoryName,
|
||||
(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 <='${endTime}'
|
||||
<if test="oId != null">
|
||||
and jdh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and jdi.depot_id = ${depotId}
|
||||
</if>
|
||||
and ifnull(jdh.delete_flag,'0') !='1'
|
||||
) numSum,
|
||||
(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 <='${endTime}'
|
||||
<if test="oId != null">
|
||||
and jdh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and jdi.depot_id = ${depotId}
|
||||
</if>
|
||||
and ifnull(jdh.delete_flag,'0') !='1'
|
||||
) priceSum
|
||||
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, standard, jsh_material_category.`Name` categoryName
|
||||
from jsh_material
|
||||
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m
|
||||
on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.mName like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findInOutMaterialCountTotal" resultType="java.lang.Integer">
|
||||
select count(1) from
|
||||
(select di.material_id, m.mName,m.Model,m.standard,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,standard,jsh_material_category.`Name` categoryName
|
||||
from jsh_material
|
||||
LEFT JOIN jsh_material_category on jsh_material.category_id=jsh_material_category.Id and ifnull(jsh_material_category.delete_flag,'0') !='1'
|
||||
where ifnull(jsh_material.delete_Flag,'0') !='1'
|
||||
) m on m.Id=di.material_id where dh.type='${type}' and dh.oper_time >='${beginTime}' and dh.oper_time <='${endTime}'
|
||||
<if test="oId != null">
|
||||
and dh.organ_id = ${oId}
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and di.depot_id = ${depotId}
|
||||
</if>
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.mName like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
GROUP BY di.material_id,m.mName,m.Model,m.standard,m.categoryName) a
|
||||
</select>
|
||||
|
||||
<select id="findStatementAccount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStatementAccount">
|
||||
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 <='${endTime}'
|
||||
<if test="organId != null">
|
||||
and dh.organ_id=${organId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
UNION ALL
|
||||
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.bill_time >='${beginTime}' and ah.bill_time <='${endTime}'
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=${organId}
|
||||
</if>
|
||||
and ifnull(ah.delete_flag,'0') !='1'
|
||||
ORDER BY oTime
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findStatementAccountCount" resultType="java.lang.Integer">
|
||||
select sum(a) from
|
||||
(
|
||||
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 <='${endTime}'
|
||||
<if test="organId != null">
|
||||
and dh.organ_id=${organId}
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
UNION ALL
|
||||
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.bill_time >='${beginTime}' and ah.bill_time <='${endTime}'
|
||||
<if test="organId != null">
|
||||
and ah.organ_id=${organId}
|
||||
</if>
|
||||
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_depot_head where type='${type}' and sub_type = '${subType}'
|
||||
and organ_id =${supplierId} and oper_time <='${endTime}'
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findAllOtherMoney" resultType="java.math.BigDecimal">
|
||||
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 <='${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, a.name AccountName
|
||||
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_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}'
|
||||
</if>
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteDepotHeadByIds">
|
||||
update jsh_depot_head
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<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_depot_head
|
||||
where 1=1
|
||||
and account_id in (
|
||||
<foreach collection="accountIds" item="accountId" separator=",">
|
||||
#{accountId}
|
||||
</foreach>
|
||||
)
|
||||
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_depot_head
|
||||
where 1=1
|
||||
and organ_id in (
|
||||
<foreach collection="organIds" item="organId" separator=",">
|
||||
#{organId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<select id="getDepotHeadListByCreator" resultMap="com.jsh.erp.datasource.mappers.DepotHeadMapper.BaseResultMap">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.DepotHeadMapper.Base_Column_List" />
|
||||
from jsh_depot_head
|
||||
where 1=1
|
||||
and creator in (
|
||||
<foreach collection="creatorArray" item="creator" separator=",">
|
||||
#{creator}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getBuyAndSaleStatistics" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(discount_last_money),0)
|
||||
FROM jsh_depot_head
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and sub_type='${subType}'
|
||||
</if>
|
||||
<if test="hasSupplier == 1">
|
||||
and organ_id is not null
|
||||
</if>
|
||||
<if test="hasSupplier == 0">
|
||||
and organ_id is null
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and oper_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and oper_time <= '${endTime}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
|
||||
SELECT
|
||||
ifnull(sum(total_price),0)
|
||||
FROM jsh_depot_head
|
||||
WHERE 1=1
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="subType != null">
|
||||
and sub_type='${subType}'
|
||||
</if>
|
||||
<if test="hasSupplier == 1">
|
||||
and organ_id is not null
|
||||
</if>
|
||||
<if test="hasSupplier == 0">
|
||||
and organ_id is null
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and oper_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and oper_time <= '${endTime}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
</mapper>
|
||||
543
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml
Normal file
543
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml
Normal file
@@ -0,0 +1,543 @@
|
||||
<?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.DepotItemMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotItem">
|
||||
<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="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" />
|
||||
</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, 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
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_depot_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_depot_item
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_depot_item
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
|
||||
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_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_depot_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="headerId != null">
|
||||
header_id,
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id,
|
||||
</if>
|
||||
<if test="materialExtendId != null">
|
||||
material_extend_id,
|
||||
</if>
|
||||
<if test="materialUnit != null">
|
||||
material_unit,
|
||||
</if>
|
||||
<if test="operNumber != null">
|
||||
oper_number,
|
||||
</if>
|
||||
<if test="basicNumber != null">
|
||||
basic_number,
|
||||
</if>
|
||||
<if test="unitPrice != null">
|
||||
unit_price,
|
||||
</if>
|
||||
<if test="taxUnitPrice != null">
|
||||
tax_unit_price,
|
||||
</if>
|
||||
<if test="allPrice != null">
|
||||
all_price,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="img != null">
|
||||
img,
|
||||
</if>
|
||||
<if test="incidentals != null">
|
||||
incidentals,
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id,
|
||||
</if>
|
||||
<if test="anotherDepotId != null">
|
||||
another_depot_id,
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate,
|
||||
</if>
|
||||
<if test="taxMoney != null">
|
||||
tax_money,
|
||||
</if>
|
||||
<if test="taxLastMoney != null">
|
||||
tax_last_money,
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
other_field1,
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
other_field2,
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
other_field3,
|
||||
</if>
|
||||
<if test="otherField4 != null">
|
||||
other_field4,
|
||||
</if>
|
||||
<if test="otherField5 != null">
|
||||
other_field5,
|
||||
</if>
|
||||
<if test="materialType != null">
|
||||
material_type,
|
||||
</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="materialId != null">
|
||||
#{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialExtendId != null">
|
||||
#{materialExtendId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialUnit != null">
|
||||
#{materialUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="operNumber != null">
|
||||
#{operNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="basicNumber != null">
|
||||
#{basicNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="unitPrice != null">
|
||||
#{unitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxUnitPrice != null">
|
||||
#{taxUnitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allPrice != null">
|
||||
#{allPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="img != null">
|
||||
#{img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="incidentals != null">
|
||||
#{incidentals,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
#{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="anotherDepotId != null">
|
||||
#{anotherDepotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
#{taxRate,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxMoney != null">
|
||||
#{taxMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxLastMoney != null">
|
||||
#{taxLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
#{otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
#{otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
#{otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField4 != null">
|
||||
#{otherField4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField5 != null">
|
||||
#{otherField5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="materialType != null">
|
||||
#{materialType,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.DepotItemExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_depot_item
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_depot_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.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.materialUnit != null">
|
||||
material_unit = #{record.materialUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.operNumber != null">
|
||||
oper_number = #{record.operNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.basicNumber != null">
|
||||
basic_number = #{record.basicNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.unitPrice != null">
|
||||
unit_price = #{record.unitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.taxUnitPrice != null">
|
||||
tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.allPrice != null">
|
||||
all_price = #{record.allPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.img != null">
|
||||
img = #{record.img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.incidentals != null">
|
||||
incidentals = #{record.incidentals,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.depotId != null">
|
||||
depot_id = #{record.depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.anotherDepotId != null">
|
||||
another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.taxRate != null">
|
||||
tax_rate = #{record.taxRate,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.taxMoney != null">
|
||||
tax_money = #{record.taxMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.taxLastMoney != null">
|
||||
tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.otherField1 != null">
|
||||
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField2 != null">
|
||||
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField3 != null">
|
||||
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField4 != null">
|
||||
other_field4 = #{record.otherField4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField5 != null">
|
||||
other_field5 = #{record.otherField5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
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},
|
||||
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}
|
||||
<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_depot_item
|
||||
<set>
|
||||
<if test="headerId != null">
|
||||
header_id = #{headerId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialExtendId != null">
|
||||
material_extend_id = #{materialExtendId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialUnit != null">
|
||||
material_unit = #{materialUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="operNumber != null">
|
||||
oper_number = #{operNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="basicNumber != null">
|
||||
basic_number = #{basicNumber,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="unitPrice != null">
|
||||
unit_price = #{unitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxUnitPrice != null">
|
||||
tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allPrice != null">
|
||||
all_price = #{allPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="img != null">
|
||||
img = #{img,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="incidentals != null">
|
||||
incidentals = #{incidentals,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id = #{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="anotherDepotId != null">
|
||||
another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate = #{taxRate,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxMoney != null">
|
||||
tax_money = #{taxMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="taxLastMoney != null">
|
||||
tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
other_field1 = #{otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
other_field2 = #{otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
other_field3 = #{otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField4 != null">
|
||||
other_field4 = #{otherField4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField5 != null">
|
||||
other_field5 = #{otherField5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
|
||||
update jsh_depot_item
|
||||
set header_id = #{headerId,jdbcType=BIGINT},
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
material_extend_id = #{materialExtendId,jdbcType=BIGINT},
|
||||
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}
|
||||
</update>
|
||||
</mapper>
|
||||
418
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
Normal file
418
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
Normal file
@@ -0,0 +1,418 @@
|
||||
<?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.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="sub_type" jdbcType="VARCHAR" property="subType" />
|
||||
<result column="b_num" jdbcType="BIGINT" property="bnum" />
|
||||
<result column="depotName" jdbcType="VARCHAR" property="depotName" />
|
||||
<result column="oTime" jdbcType="TIMESTAMP" property="otime" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultAndMaterialMap" type="com.jsh.erp.datasource.entities.DepotItemVo4Material">
|
||||
<result column="mName" jdbcType="VARCHAR" property="mname" />
|
||||
<result column="mModel" jdbcType="VARCHAR" property="mmodel" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultWithInfoExMap" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx">
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
|
||||
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
|
||||
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
|
||||
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
|
||||
<result column="MOtherField3" jdbcType="VARCHAR" property="MOtherField3" />
|
||||
<result column="DepotName" jdbcType="VARCHAR" property="DepotName" />
|
||||
<result column="AnotherDepotName" jdbcType="VARCHAR" property="AnotherDepotName" />
|
||||
<result column="UnitId" jdbcType="BIGINT" property="UnitId" />
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
<result column="ratio" jdbcType="INTEGER" property="ratio" />
|
||||
<result column="other_unit" jdbcType="INTEGER" property="otherUnit" />
|
||||
<result column="barCode" jdbcType="VARCHAR" property="barCode" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap" id="ResultByMaterial" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx">
|
||||
<result column="MId" jdbcType="VARCHAR" property="MId" />
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
|
||||
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
|
||||
<result column="MOtherField3" jdbcType="VARCHAR" property="MOtherField3" />
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
|
||||
<result column="MId" jdbcType="VARCHAR" property="MId" />
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MMfrs" jdbcType="VARCHAR" property="MMfrs" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MStandard" jdbcType="VARCHAR" property="MStandard" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="MOtherField1" jdbcType="VARCHAR" property="MOtherField1" />
|
||||
<result column="MOtherField2" jdbcType="VARCHAR" property="MOtherField2" />
|
||||
<result column="MOtherField3" jdbcType="VARCHAR" property="MOtherField3" />
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
<result column="safetystock" jdbcType="DECIMAL" property="safetystock" />
|
||||
<result column="current_number" jdbcType="DECIMAL" property="currentNumber" />
|
||||
<result column="linjieNumber" jdbcType="DECIMAL" property="linjieNumber" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="StockMap" type="com.jsh.erp.datasource.vo.DepotItemVo4Stock">
|
||||
<result column="in_stock" jdbcType="DECIMAL" property="inNum" />
|
||||
<result column="out_stock" jdbcType="DECIMAL" property="outNum" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_depot_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countsByDepotItem" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_depot_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
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.sub_type,
|
||||
case
|
||||
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,
|
||||
(select name from jsh_depot d where d.id=di.depot_id and ifnull(d.delete_flag,'0') !='1') as depotName,
|
||||
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}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Long">
|
||||
select count(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.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
|
||||
dp1.name DepotName,dp2.name AnotherDepotName, u.id UnitId, u.name unit_name, u.ratio, u.other_unit, me.bar_code barCode
|
||||
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.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.standard MStandard,
|
||||
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
|
||||
m.unit MaterialUnit, m.color MColor, u.name unit_name,
|
||||
(select purchase_decimal from jsh_material_extend me
|
||||
where me.material_id=m.id and me.default_flag=1 and ifnull(me.delete_Flag,'0') !='1' limit 0,1)
|
||||
purchase_decimal
|
||||
from jsh_material m
|
||||
left join jsh_depot_item di on di.material_id=m.id and ifnull(di.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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name
|
||||
order by m.name, m.model asc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findByAllCount" resultType="java.lang.Integer">
|
||||
select count(1) from (select m.id
|
||||
from jsh_material m
|
||||
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="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
</if>
|
||||
and ifnull(di.delete_flag,'0') !='1'
|
||||
group by m.id) cc
|
||||
</select>
|
||||
|
||||
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
|
||||
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 >= '${MonthTime}-01 00:00:00'
|
||||
and dh.oper_time <= '${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(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 >= '${MonthTime}-01 00:00:00'
|
||||
and dh.oper_time <= '${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(discount_last_money),0) as allMoney from jsh_depot_head dh
|
||||
where 1=1
|
||||
and dh.type='${type}' and dh.sub_type='${subType}'
|
||||
and dh.oper_time >= '${MonthTime}-01 00:00:00'
|
||||
and dh.oper_time <= '${MonthTime}-31 23:59:59'
|
||||
and ifnull(dh.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getStockCheckSum" resultType="java.math.BigDecimal">
|
||||
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.material_id=#{mId}
|
||||
</if>
|
||||
and dh.sub_type='盘点复盘' and dh.`Status`='1'
|
||||
<if test="depotId != null">
|
||||
and di.depot_id=#{depotId}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${endTime}'
|
||||
</if>
|
||||
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.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_depot_head dh,jsh_depot_item di
|
||||
where 1=1
|
||||
and dh.id=di.header_id
|
||||
and di.material_id=#{mId}
|
||||
<if test="beginTime != null">
|
||||
and dh.oper_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and dh.oper_time <= '${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
|
||||
</select>
|
||||
|
||||
<select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem">
|
||||
select
|
||||
dep.id,dep.header_id,dep.material_id,dep.material_unit,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.header_id = #{depotheadId}
|
||||
</if>
|
||||
and dep.material_id=mat.id
|
||||
<if test="enableSerialNumber != null">
|
||||
and mat.enable_serial_number = #{enableSerialNumber}
|
||||
</if>
|
||||
and ifnull(dep.delete_flag,'0') !='1'
|
||||
and ifnull(mat.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<delete id="deleteDepotItemByDepotHeadIds">
|
||||
delete from jsh_depot_item
|
||||
where 1=1
|
||||
and header_id in
|
||||
(
|
||||
<foreach collection="depotheadIds" item="depotheadId" separator=",">
|
||||
#{depotheadId}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
|
||||
<update id="batchDeleteDepotItemByDepotHeadIds">
|
||||
update jsh_depot_item
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and header_id in
|
||||
(
|
||||
<foreach collection="depotheadIds" item="depotheadId" separator=",">
|
||||
#{depotheadId}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<update id="batchDeleteDepotItemByIds">
|
||||
update jsh_depot_item
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<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_depot_item
|
||||
where 1=1
|
||||
and depot_id in (
|
||||
<foreach collection="depotIds" item="depotId" separator=",">
|
||||
#{depotId}
|
||||
</foreach>
|
||||
)
|
||||
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_depot_item
|
||||
where 1=1
|
||||
and material_id in (
|
||||
<foreach collection="materialIds" item="materialId" separator=",">
|
||||
#{materialId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
|
||||
select m.id MId, m.name MName, m.mfrs MMfrs, m.model MModel, m.standard MStandard,m.color MColor,
|
||||
m.other_field1 MOtherField1,m.other_field2 MOtherField2,m.other_field3 MOtherField3,
|
||||
m.unit MaterialUnit, u.name unit_name,mcs.current_number,ifnull(m.safety_stock,0) safetystock,
|
||||
(ifnull(m.safety_stock,0)-mcs.current_number) linjieNumber
|
||||
from jsh_material m
|
||||
left join jsh_material_current_stock mcs on mcs.material_id=m.id and ifnull(mcs.delete_Flag,'0') !='1'
|
||||
left join jsh_depot_item di on di.material_id=m.id and ifnull(di.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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
and ifnull(m.safety_stock,0) > mcs.current_number
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and mcs.depot_id= ${depotId}
|
||||
</if>
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name
|
||||
order by linjieNumber desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findStockWarningCountTotal" resultType="java.lang.Integer">
|
||||
select count(1) from
|
||||
(select m.id
|
||||
from jsh_material m
|
||||
left join jsh_material_current_stock mcs on mcs.material_id=m.id and ifnull(mcs.delete_Flag,'0') !='1'
|
||||
left join jsh_depot_item di on di.material_id=m.id and ifnull(di.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_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
and ifnull(m.safety_stock,0) > mcs.current_number
|
||||
<if test="materialParam != null and materialParam !=''">
|
||||
<bind name="bindKey" value="'%'+materialParam+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
and mcs.depot_id= ${depotId}
|
||||
</if>
|
||||
group by m.id,m.name, m.model, m.unit, m.color, u.name) tb
|
||||
</select>
|
||||
</mapper>
|
||||
383
jshERP-boot/src/main/resources/mapper_xml/DepotMapper.xml
Normal file
383
jshERP-boot/src/main/resources/mapper_xml/DepotMapper.xml
Normal file
@@ -0,0 +1,383 @@
|
||||
<?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.DepotMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Depot">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="warehousing" jdbcType="DECIMAL" property="warehousing" />
|
||||
<result column="truckage" jdbcType="DECIMAL" property="truckage" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="principal" jdbcType="BIGINT" property="principal" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
<result column="is_default" jdbcType="BIT" property="isDefault" />
|
||||
</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, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
|
||||
delete_Flag, is_default
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" 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_depot
|
||||
<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_depot
|
||||
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_depot
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_depot
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Depot">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_depot (id, name, address,
|
||||
warehousing, truckage, type,
|
||||
sort, remark, principal,
|
||||
tenant_id, delete_Flag, is_default
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
||||
#{warehousing,jdbcType=DECIMAL}, #{truckage,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER},
|
||||
#{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{principal,jdbcType=BIGINT},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}, #{isDefault,jdbcType=BIT}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Depot">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_depot
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="warehousing != null">
|
||||
warehousing,
|
||||
</if>
|
||||
<if test="truckage != null">
|
||||
truckage,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="principal != null">
|
||||
principal,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag,
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
is_default,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="warehousing != null">
|
||||
#{warehousing,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="truckage != null">
|
||||
#{truckage,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="principal != null">
|
||||
#{principal,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
#{isDefault,jdbcType=BIT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_depot
|
||||
<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_depot
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.address != null">
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.warehousing != null">
|
||||
warehousing = #{record.warehousing,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.truckage != null">
|
||||
truckage = #{record.truckage,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.principal != null">
|
||||
principal = #{record.principal,jdbcType=BIGINT},
|
||||
</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>
|
||||
<if test="record.isDefault != null">
|
||||
is_default = #{record.isDefault,jdbcType=BIT},
|
||||
</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_depot
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
warehousing = #{record.warehousing,jdbcType=DECIMAL},
|
||||
truckage = #{record.truckage,jdbcType=DECIMAL},
|
||||
type = #{record.type,jdbcType=INTEGER},
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
principal = #{record.principal,jdbcType=BIGINT},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
is_default = #{record.isDefault,jdbcType=BIT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Depot">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_depot
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="warehousing != null">
|
||||
warehousing = #{warehousing,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="truckage != null">
|
||||
truckage = #{truckage,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="principal != null">
|
||||
principal = #{principal,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
is_default = #{isDefault,jdbcType=BIT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Depot">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_depot
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
warehousing = #{warehousing,jdbcType=DECIMAL},
|
||||
truckage = #{truckage,jdbcType=DECIMAL},
|
||||
type = #{type,jdbcType=INTEGER},
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
principal = #{principal,jdbcType=BIGINT},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
is_default = #{isDefault,jdbcType=BIT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
59
jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml
Normal file
59
jshERP-boot/src/main/resources/mapper_xml/DepotMapperEx.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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.DepotMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.DepotMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.DepotEx">
|
||||
<result column="principalName" jdbcType="VARCHAR" property="principalName" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionDepot" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="ResultMapEx">
|
||||
select dep.*,usr.username as principalName
|
||||
FROM jsh_depot dep
|
||||
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and dep.name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dep.type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and dep.remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(dep.delete_Flag,'0') !='1'
|
||||
order by dep.sort asc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByDepot" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(dep.id)
|
||||
FROM jsh_depot dep
|
||||
left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and dep.name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and dep.type=${type}
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and dep.remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(dep.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteDepotByIds">
|
||||
update jsh_depot
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
338
jshERP-boot/src/main/resources/mapper_xml/FunctionMapper.xml
Normal file
338
jshERP-boot/src/main/resources/mapper_xml/FunctionMapper.xml
Normal file
@@ -0,0 +1,338 @@
|
||||
<?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.FunctionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Function">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="number" jdbcType="VARCHAR" property="number" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="parent_number" jdbcType="VARCHAR" property="parentNumber" />
|
||||
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||
<result column="component" jdbcType="VARCHAR" property="component" />
|
||||
<result column="state" jdbcType="BIT" property="state" />
|
||||
<result column="sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="enabled" jdbcType="BIT" property="enabled" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="push_btn" jdbcType="VARCHAR" property="pushBtn" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
<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, number, name, parent_number, url, component, state, sort, enabled, type, push_btn,
|
||||
icon, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_function
|
||||
<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_function
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_function
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.FunctionExample">
|
||||
delete from jsh_function
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Function">
|
||||
insert into jsh_function (id, number, name,
|
||||
parent_number, url, component,
|
||||
state, sort, enabled, type,
|
||||
push_btn, icon, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{parentNumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{component,jdbcType=VARCHAR},
|
||||
#{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR},
|
||||
#{pushBtn,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Function">
|
||||
insert into jsh_function
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="parentNumber != null">
|
||||
parent_number,
|
||||
</if>
|
||||
<if test="url != null">
|
||||
url,
|
||||
</if>
|
||||
<if test="component != null">
|
||||
component,
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="pushBtn != null">
|
||||
push_btn,
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
icon,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
#{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentNumber != null">
|
||||
#{parentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="url != null">
|
||||
#{url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="component != null">
|
||||
#{component,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
#{state,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pushBtn != null">
|
||||
#{pushBtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
#{icon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.FunctionExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_function
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_function
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.number != null">
|
||||
number = #{record.number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.parentNumber != null">
|
||||
parent_number = #{record.parentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.url != null">
|
||||
url = #{record.url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.component != null">
|
||||
component = #{record.component,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.state != null">
|
||||
state = #{record.state,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.pushBtn != null">
|
||||
push_btn = #{record.pushBtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.icon != null">
|
||||
icon = #{record.icon,jdbcType=VARCHAR},
|
||||
</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_function
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
number = #{record.number,jdbcType=VARCHAR},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
parent_number = #{record.parentNumber,jdbcType=VARCHAR},
|
||||
url = #{record.url,jdbcType=VARCHAR},
|
||||
component = #{record.component,jdbcType=VARCHAR},
|
||||
state = #{record.state,jdbcType=BIT},
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
push_btn = #{record.pushBtn,jdbcType=VARCHAR},
|
||||
icon = #{record.icon,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.Function">
|
||||
update jsh_function
|
||||
<set>
|
||||
<if test="number != null">
|
||||
number = #{number,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentNumber != null">
|
||||
parent_number = #{parentNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="url != null">
|
||||
url = #{url,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="component != null">
|
||||
component = #{component,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state = #{state,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="pushBtn != null">
|
||||
push_btn = #{pushBtn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="icon != null">
|
||||
icon = #{icon,jdbcType=VARCHAR},
|
||||
</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.Function">
|
||||
update jsh_function
|
||||
set number = #{number,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
parent_number = #{parentNumber,jdbcType=VARCHAR},
|
||||
url = #{url,jdbcType=VARCHAR},
|
||||
component = #{component,jdbcType=VARCHAR},
|
||||
state = #{state,jdbcType=BIT},
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
push_btn = #{pushBtn,jdbcType=VARCHAR},
|
||||
icon = #{icon,jdbcType=VARCHAR},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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.FunctionMapperEx">
|
||||
<select id="selectByConditionFunction" parameterType="com.jsh.erp.datasource.entities.FunctionExample" resultMap="com.jsh.erp.datasource.mappers.FunctionMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_function
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by sort asc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByFunction" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_function
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteFunctionByIds">
|
||||
update jsh_function
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
228
jshERP-boot/src/main/resources/mapper_xml/InOutItemMapper.xml
Normal file
228
jshERP-boot/src/main/resources/mapper_xml/InOutItemMapper.xml
Normal file
@@ -0,0 +1,228 @@
|
||||
<?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.InOutItemMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.InOutItem">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<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, name, type, remark, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.InOutItemExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_in_out_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_in_out_item
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_in_out_item
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.InOutItemExample">
|
||||
delete from jsh_in_out_item
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.InOutItem">
|
||||
insert into jsh_in_out_item (id, name, type,
|
||||
remark, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.InOutItem">
|
||||
insert into jsh_in_out_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</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="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</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.InOutItemExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_in_out_item
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_in_out_item
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</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_in_out_item
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
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.InOutItem">
|
||||
update jsh_in_out_item
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</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.InOutItem">
|
||||
update jsh_in_out_item
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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.InOutItemMapperEx">
|
||||
<select id="selectByConditionInOutItem" parameterType="com.jsh.erp.datasource.entities.InOutItemExample" resultMap="com.jsh.erp.datasource.mappers.InOutItemMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_in_out_item
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByInOutItem" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_in_out_item
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
and remark like '%${remark}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteInOutItemByIds">
|
||||
update jsh_in_out_item
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
258
jshERP-boot/src/main/resources/mapper_xml/LogMapper.xml
Normal file
258
jshERP-boot/src/main/resources/mapper_xml/LogMapper.xml
Normal file
@@ -0,0 +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.LogMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Log">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
||||
<result column="operation" jdbcType="VARCHAR" property="operation" />
|
||||
<result column="client_ip" jdbcType="VARCHAR" property="clientIp" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</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, user_id, operation, client_ip, create_time, status, content, tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.LogExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_log
|
||||
<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_log
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_log
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.LogExample">
|
||||
delete from jsh_log
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Log">
|
||||
insert into jsh_log (id, user_id, operation,
|
||||
client_ip, create_time, status,
|
||||
content, tenant_id)
|
||||
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{operation,jdbcType=VARCHAR},
|
||||
#{clientIp,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT},
|
||||
#{content,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Log">
|
||||
insert into jsh_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="operation != null">
|
||||
operation,
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
client_ip,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="operation != null">
|
||||
#{operation,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
#{clientIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.LogExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_log
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_log
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.operation != null">
|
||||
operation = #{record.operation,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.clientIp != null">
|
||||
client_ip = #{record.clientIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
status = #{record.status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.content != null">
|
||||
content = #{record.content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update jsh_log
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
operation = #{record.operation,jdbcType=VARCHAR},
|
||||
client_ip = #{record.clientIp,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
status = #{record.status,jdbcType=TINYINT},
|
||||
content = #{record.content,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Log">
|
||||
update jsh_log
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="operation != null">
|
||||
operation = #{operation,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
client_ip = #{clientIp,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Log">
|
||||
update jsh_log
|
||||
set user_id = #{userId,jdbcType=BIGINT},
|
||||
operation = #{operation,jdbcType=VARCHAR},
|
||||
client_ip = #{clientIp,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
status = #{status,jdbcType=TINYINT},
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
67
jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml
Normal file
67
jshERP-boot/src/main/resources/mapper_xml/LogMapperEx.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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.LogMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.LogMapper.BaseResultMap" id="ResultExMap" type="com.jsh.erp.datasource.vo.LogVo4List">
|
||||
<result column="userName" jdbcType="VARCHAR" property="userName" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionLog" parameterType="com.jsh.erp.datasource.entities.LogExample" resultMap="ResultExMap">
|
||||
select l.*,u.username userName
|
||||
FROM jsh_log l
|
||||
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
|
||||
where 1=1
|
||||
<if test="operation != null">
|
||||
and l.operation like '%${operation}%'
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and l.user_id=${userId}
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
and l.client_ip like '%${clientIp}%'
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and l.status=${status}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and l.create_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and l.create_time <= '${endTime}'
|
||||
</if>
|
||||
<if test="content != null">
|
||||
and l.content like '%${content}%'
|
||||
</if>
|
||||
order by l.create_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByLog" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM jsh_log l
|
||||
left join jsh_user u on l.user_id = u.id and ifnull(u.status,'0') not in('1','2')
|
||||
WHERE 1=1
|
||||
<if test="operation != null">
|
||||
and l.operation like '%${operation}%'
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and l.user_id=${userId}
|
||||
</if>
|
||||
<if test="clientIp != null">
|
||||
and l.client_ip like '%${clientIp}%'
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and l.status = ${status}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
and l.create_time >= '${beginTime}'
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and l.create_time <= '${endTime}'
|
||||
</if>
|
||||
<if test="content != null">
|
||||
and l.content like '%${content}%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,306 @@
|
||||
<?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.MaterialCategoryMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialCategory">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="category_level" jdbcType="SMALLINT" property="categoryLevel" />
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
|
||||
<result column="sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="serial_no" jdbcType="VARCHAR" property="serialNo" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<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, name, category_level, parent_id, sort, serial_no, remark, create_time, update_time,
|
||||
tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material_category
|
||||
<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_material_category
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material_category
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample">
|
||||
delete from jsh_material_category
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialCategory">
|
||||
insert into jsh_material_category (id, name, category_level,
|
||||
parent_id, sort, serial_no,
|
||||
remark, create_time, update_time,
|
||||
tenant_id, delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{categoryLevel,jdbcType=SMALLINT},
|
||||
#{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
|
||||
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialCategory">
|
||||
insert into jsh_material_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="categoryLevel != null">
|
||||
category_level,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
serial_no,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</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="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="categoryLevel != null">
|
||||
#{categoryLevel,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
#{serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</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.MaterialCategoryExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material_category
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material_category
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.categoryLevel != null">
|
||||
category_level = #{record.categoryLevel,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id = #{record.parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.serialNo != null">
|
||||
serial_no = #{record.serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</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_material_category
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
category_level = #{record.categoryLevel,jdbcType=SMALLINT},
|
||||
parent_id = #{record.parentId,jdbcType=BIGINT},
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
serial_no = #{record.serialNo,jdbcType=VARCHAR},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
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.MaterialCategory">
|
||||
update jsh_material_category
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="categoryLevel != null">
|
||||
category_level = #{categoryLevel,jdbcType=SMALLINT},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="serialNo != null">
|
||||
serial_no = #{serialNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</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.MaterialCategory">
|
||||
update jsh_material_category
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
category_level = #{categoryLevel,jdbcType=SMALLINT},
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
serial_no = #{serialNo,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,142 @@
|
||||
<?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.MaterialCategoryMapperEx">
|
||||
<select id="selectByConditionMaterialCategory" parameterType="com.jsh.erp.datasource.entities.MaterialCategoryExample" resultMap="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_material_category
|
||||
where 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = ${parentId}
|
||||
</if>
|
||||
and Id !=1
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByMaterialCategory" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_material_category
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = ${parentId}
|
||||
</if>
|
||||
and Id !=1
|
||||
</select>
|
||||
|
||||
<resultMap id="BaseTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
|
||||
<result column="id" property="id"/>
|
||||
<result column="id" property="key"/>
|
||||
<result column="id" property="value"/>
|
||||
<result column="name" property="title"/>
|
||||
<collection column="{currentId=currentId,id=id}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="NextTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
|
||||
<result column="id" property="id"/>
|
||||
<result column="id" property="key"/>
|
||||
<result column="id" property="value"/>
|
||||
<result column="name" property="title"/>
|
||||
<collection column="{currentId=currentId,id=id}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResultCategoryMapList" type="com.jsh.erp.datasource.entities.MaterialCategory">
|
||||
<result column="id" jdbcType="BIGINT" property="id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, name
|
||||
</sql>
|
||||
|
||||
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>,#{currentId} as currentId
|
||||
FROM jsh_material_category
|
||||
WHERE parent_id = #{id}
|
||||
<if test="currentId != null">
|
||||
and id !=#{currentId}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="getNodeTree" resultMap="BaseTreeResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>,#{currentId} as currentId
|
||||
FROM jsh_material_category
|
||||
WHERE parent_id is null
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="currentId != null">
|
||||
and id !=#{currentId}
|
||||
</if>
|
||||
order by sort asc
|
||||
</select>
|
||||
<insert id="addMaterialCategory" parameterType="com.jsh.erp.datasource.entities.MaterialCategory"
|
||||
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into jsh_material_category
|
||||
(name, category_level, parent_id, sort,status,serial_no,remark,
|
||||
create_time, update_time)
|
||||
values
|
||||
(#{name},#{categoryLevel},#{parentId},#{sort},#{status},#{serialNo},#{remark},
|
||||
#{createTime},#{updateTime}
|
||||
)
|
||||
</insert>
|
||||
<update id="batchDeleteMaterialCategoryByIds">
|
||||
update jsh_material_category
|
||||
set update_time=#{updateTime},delete_flag='1'
|
||||
where id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<update id="editMaterialCategory">
|
||||
update jsh_material_category
|
||||
set update_time=#{updateTime},
|
||||
parent_id=#{parentId},sort=#{sort},serial_no=#{serialNo},
|
||||
name=#{name},remark=#{remark}
|
||||
where id =#{id}
|
||||
</update>
|
||||
<select id="getMaterialCategoryBySerialNo" resultMap="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.BaseResultMap">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.Base_Column_List"/>
|
||||
FROM jsh_material_category
|
||||
where 1=1
|
||||
and serial_no=#{serialNo}
|
||||
<if test="id != null">
|
||||
and id!=#{id}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<select id="getMaterialCategoryListByCategoryIds" resultMap="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.BaseResultMap">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.MaterialCategoryMapper.Base_Column_List" />
|
||||
from jsh_material_category
|
||||
where 1=1
|
||||
and parent_id in (
|
||||
<foreach collection="parentIds" item="parentId" separator=",">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getListByParentId" resultMap="ResultCategoryMapList">
|
||||
SELECT id FROM jsh_material_category
|
||||
where 1=1
|
||||
<if test="parentId != null and parentId !=''">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,228 @@
|
||||
<?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.MaterialCurrentStockMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialCurrentStock">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="material_id" jdbcType="BIGINT" property="materialId" />
|
||||
<result column="depot_id" jdbcType="BIGINT" property="depotId" />
|
||||
<result column="current_number" jdbcType="DECIMAL" property="currentNumber" />
|
||||
<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, material_id, depot_id, current_number, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCurrentStockExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material_current_stock
|
||||
<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_material_current_stock
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material_current_stock
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialCurrentStockExample">
|
||||
delete from jsh_material_current_stock
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialCurrentStock">
|
||||
insert into jsh_material_current_stock (id, material_id, depot_id,
|
||||
current_number, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT},
|
||||
#{currentNumber,jdbcType=DECIMAL}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialCurrentStock">
|
||||
insert into jsh_material_current_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id,
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id,
|
||||
</if>
|
||||
<if test="currentNumber != null">
|
||||
current_number,
|
||||
</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="materialId != null">
|
||||
#{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
#{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="currentNumber != null">
|
||||
#{currentNumber,jdbcType=DECIMAL},
|
||||
</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.MaterialCurrentStockExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material_current_stock
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material_current_stock
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.materialId != null">
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.depotId != null">
|
||||
depot_id = #{record.depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.currentNumber != null">
|
||||
current_number = #{record.currentNumber,jdbcType=DECIMAL},
|
||||
</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_material_current_stock
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
depot_id = #{record.depotId,jdbcType=BIGINT},
|
||||
current_number = #{record.currentNumber,jdbcType=DECIMAL},
|
||||
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.MaterialCurrentStock">
|
||||
update jsh_material_current_stock
|
||||
<set>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id = #{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="currentNumber != null">
|
||||
current_number = #{currentNumber,jdbcType=DECIMAL},
|
||||
</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.MaterialCurrentStock">
|
||||
update jsh_material_current_stock
|
||||
set material_id = #{materialId,jdbcType=BIGINT},
|
||||
depot_id = #{depotId,jdbcType=BIGINT},
|
||||
current_number = #{currentNumber,jdbcType=DECIMAL},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,371 @@
|
||||
<?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.MaterialExtendMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialExtend">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="material_id" jdbcType="BIGINT" property="materialId" />
|
||||
<result column="bar_code" jdbcType="VARCHAR" property="barCode" />
|
||||
<result column="commodity_unit" jdbcType="VARCHAR" property="commodityUnit" />
|
||||
<result column="purchase_decimal" jdbcType="DECIMAL" property="purchaseDecimal" />
|
||||
<result column="commodity_decimal" jdbcType="DECIMAL" property="commodityDecimal" />
|
||||
<result column="wholesale_decimal" jdbcType="DECIMAL" property="wholesaleDecimal" />
|
||||
<result column="low_decimal" jdbcType="DECIMAL" property="lowDecimal" />
|
||||
<result column="default_flag" jdbcType="VARCHAR" property="defaultFlag" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="create_serial" jdbcType="VARCHAR" property="createSerial" />
|
||||
<result column="update_serial" jdbcType="VARCHAR" property="updateSerial" />
|
||||
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||
<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, material_id, bar_code, commodity_unit, purchase_decimal, commodity_decimal, wholesale_decimal,
|
||||
low_decimal, default_flag, create_time, create_serial, update_serial, update_time,
|
||||
tenant_id, delete_Flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material_extend
|
||||
<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_material_extend
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material_extend
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample">
|
||||
delete from jsh_material_extend
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
|
||||
insert into jsh_material_extend (id, material_id, bar_code,
|
||||
commodity_unit, purchase_decimal, commodity_decimal,
|
||||
wholesale_decimal, low_decimal, default_flag,
|
||||
create_time, create_serial, update_serial,
|
||||
update_time, tenant_id, delete_Flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{barCode,jdbcType=VARCHAR},
|
||||
#{commodityUnit,jdbcType=VARCHAR}, #{purchaseDecimal,jdbcType=DECIMAL}, #{commodityDecimal,jdbcType=DECIMAL},
|
||||
#{wholesaleDecimal,jdbcType=DECIMAL}, #{lowDecimal,jdbcType=DECIMAL}, #{defaultFlag,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{createSerial,jdbcType=VARCHAR}, #{updateSerial,jdbcType=VARCHAR},
|
||||
#{updateTime,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialExtend">
|
||||
insert into jsh_material_extend
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id,
|
||||
</if>
|
||||
<if test="barCode != null">
|
||||
bar_code,
|
||||
</if>
|
||||
<if test="commodityUnit != null">
|
||||
commodity_unit,
|
||||
</if>
|
||||
<if test="purchaseDecimal != null">
|
||||
purchase_decimal,
|
||||
</if>
|
||||
<if test="commodityDecimal != null">
|
||||
commodity_decimal,
|
||||
</if>
|
||||
<if test="wholesaleDecimal != null">
|
||||
wholesale_decimal,
|
||||
</if>
|
||||
<if test="lowDecimal != null">
|
||||
low_decimal,
|
||||
</if>
|
||||
<if test="defaultFlag != null">
|
||||
default_flag,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="createSerial != null">
|
||||
create_serial,
|
||||
</if>
|
||||
<if test="updateSerial != null">
|
||||
update_serial,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</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="materialId != null">
|
||||
#{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="barCode != null">
|
||||
#{barCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commodityUnit != null">
|
||||
#{commodityUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="purchaseDecimal != null">
|
||||
#{purchaseDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="commodityDecimal != null">
|
||||
#{commodityDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="wholesaleDecimal != null">
|
||||
#{wholesaleDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowDecimal != null">
|
||||
#{lowDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="defaultFlag != null">
|
||||
#{defaultFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createSerial != null">
|
||||
#{createSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateSerial != null">
|
||||
#{updateSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=BIGINT},
|
||||
</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.MaterialExtendExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material_extend
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material_extend
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.materialId != null">
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.barCode != null">
|
||||
bar_code = #{record.barCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.commodityUnit != null">
|
||||
commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.purchaseDecimal != null">
|
||||
purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.commodityDecimal != null">
|
||||
commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.wholesaleDecimal != null">
|
||||
wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.lowDecimal != null">
|
||||
low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.defaultFlag != null">
|
||||
default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.createSerial != null">
|
||||
create_serial = #{record.createSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateSerial != null">
|
||||
update_serial = #{record.updateSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
</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_material_extend
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
bar_code = #{record.barCode,jdbcType=VARCHAR},
|
||||
commodity_unit = #{record.commodityUnit,jdbcType=VARCHAR},
|
||||
purchase_decimal = #{record.purchaseDecimal,jdbcType=DECIMAL},
|
||||
commodity_decimal = #{record.commodityDecimal,jdbcType=DECIMAL},
|
||||
wholesale_decimal = #{record.wholesaleDecimal,jdbcType=DECIMAL},
|
||||
low_decimal = #{record.lowDecimal,jdbcType=DECIMAL},
|
||||
default_flag = #{record.defaultFlag,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
create_serial = #{record.createSerial,jdbcType=VARCHAR},
|
||||
update_serial = #{record.updateSerial,jdbcType=VARCHAR},
|
||||
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||
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.MaterialExtend">
|
||||
update jsh_material_extend
|
||||
<set>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="barCode != null">
|
||||
bar_code = #{barCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="commodityUnit != null">
|
||||
commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="purchaseDecimal != null">
|
||||
purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="commodityDecimal != null">
|
||||
commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="wholesaleDecimal != null">
|
||||
wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowDecimal != null">
|
||||
low_decimal = #{lowDecimal,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="defaultFlag != null">
|
||||
default_flag = #{defaultFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createSerial != null">
|
||||
create_serial = #{createSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateSerial != null">
|
||||
update_serial = #{updateSerial,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
</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.MaterialExtend">
|
||||
update jsh_material_extend
|
||||
set material_id = #{materialId,jdbcType=BIGINT},
|
||||
bar_code = #{barCode,jdbcType=VARCHAR},
|
||||
commodity_unit = #{commodityUnit,jdbcType=VARCHAR},
|
||||
purchase_decimal = #{purchaseDecimal,jdbcType=DECIMAL},
|
||||
commodity_decimal = #{commodityDecimal,jdbcType=DECIMAL},
|
||||
wholesale_decimal = #{wholesaleDecimal,jdbcType=DECIMAL},
|
||||
low_decimal = #{lowDecimal,jdbcType=DECIMAL},
|
||||
default_flag = #{defaultFlag,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
create_serial = #{createSerial,jdbcType=VARCHAR},
|
||||
update_serial = #{updateSerial,jdbcType=VARCHAR},
|
||||
update_time = #{updateTime,jdbcType=BIGINT},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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.MaterialExtendMapperEx" >
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.MaterialExtendMapper.BaseResultMap" id="ResultMapList" type="com.jsh.erp.datasource.vo.MaterialExtendVo4List">
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultMap="ResultMapList">
|
||||
select DISTINCT d.Id,d.bar_code,d.commodity_unit,d.commodity_decimal,d.purchase_decimal,d.wholesale_decimal,d.low_decimal
|
||||
from jsh_material_extend d
|
||||
where d.material_id = '${materialId}'
|
||||
and ifnull(d.delete_Flag,'0') !='1'
|
||||
order by d.default_flag desc,d.id asc
|
||||
</select>
|
||||
|
||||
<select id="getMaxTimeByTenantAndTime" resultType="java.lang.Long">
|
||||
select max(update_time) from
|
||||
(
|
||||
select update_time from jsh_material_extend
|
||||
where 1=1
|
||||
<if test="lastTime != null">
|
||||
and update_time > ${lastTime}
|
||||
</if>
|
||||
order by update_time asc
|
||||
<if test="syncNum != null">
|
||||
limit 0,#{syncNum}
|
||||
</if>
|
||||
) time_list
|
||||
</select>
|
||||
|
||||
<select id="getListByMId" resultType="com.jsh.erp.datasource.entities.MaterialExtend">
|
||||
select
|
||||
<include refid="com.jsh.erp.datasource.mappers.MaterialExtendMapper.Base_Column_List" />
|
||||
from jsh_material_extend
|
||||
where 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
and material_id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
group by material_id
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteMaterialExtendByIds">
|
||||
update jsh_material_extend
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<update id="batchDeleteMaterialExtendByMIds">
|
||||
update jsh_material_extend
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
and material_id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,228 @@
|
||||
<?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.MaterialInitialStockMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialInitialStock">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="material_id" jdbcType="BIGINT" property="materialId" />
|
||||
<result column="depot_id" jdbcType="BIGINT" property="depotId" />
|
||||
<result column="number" jdbcType="DECIMAL" property="number" />
|
||||
<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, material_id, depot_id, number, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialInitialStockExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material_initial_stock
|
||||
<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_material_initial_stock
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material_initial_stock
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialInitialStockExample">
|
||||
delete from jsh_material_initial_stock
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialInitialStock">
|
||||
insert into jsh_material_initial_stock (id, material_id, depot_id,
|
||||
number, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{depotId,jdbcType=BIGINT},
|
||||
#{number,jdbcType=DECIMAL}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialInitialStock">
|
||||
insert into jsh_material_initial_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id,
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id,
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number,
|
||||
</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="materialId != null">
|
||||
#{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
#{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
#{number,jdbcType=DECIMAL},
|
||||
</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.MaterialInitialStockExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material_initial_stock
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material_initial_stock
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.materialId != null">
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.depotId != null">
|
||||
depot_id = #{record.depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.number != null">
|
||||
number = #{record.number,jdbcType=DECIMAL},
|
||||
</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_material_initial_stock
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
depot_id = #{record.depotId,jdbcType=BIGINT},
|
||||
number = #{record.number,jdbcType=DECIMAL},
|
||||
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.MaterialInitialStock">
|
||||
update jsh_material_initial_stock
|
||||
<set>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotId != null">
|
||||
depot_id = #{depotId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="number != null">
|
||||
number = #{number,jdbcType=DECIMAL},
|
||||
</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.MaterialInitialStock">
|
||||
update jsh_material_initial_stock
|
||||
set material_id = #{materialId,jdbcType=BIGINT},
|
||||
depot_id = #{depotId,jdbcType=BIGINT},
|
||||
number = #{number,jdbcType=DECIMAL},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
418
jshERP-boot/src/main/resources/mapper_xml/MaterialMapper.xml
Normal file
418
jshERP-boot/src/main/resources/mapper_xml/MaterialMapper.xml
Normal file
@@ -0,0 +1,418 @@
|
||||
<?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.MaterialMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Material">
|
||||
<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" />
|
||||
</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, 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
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material
|
||||
<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_material
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialExample">
|
||||
delete from jsh_material
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Material">
|
||||
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},
|
||||
#{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}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Material">
|
||||
insert into jsh_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
category_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="mfrs != null">
|
||||
mfrs,
|
||||
</if>
|
||||
<if test="safetyStock != null">
|
||||
safety_stock,
|
||||
</if>
|
||||
<if test="model != null">
|
||||
model,
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
standard,
|
||||
</if>
|
||||
<if test="color != null">
|
||||
color,
|
||||
</if>
|
||||
<if test="unit != null">
|
||||
unit,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
unit_id,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
other_field1,
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
other_field2,
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
other_field3,
|
||||
</if>
|
||||
<if test="enableSerialNumber != null">
|
||||
enable_serial_number,
|
||||
</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="categoryId != null">
|
||||
#{categoryId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mfrs != null">
|
||||
#{mfrs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="safetyStock != null">
|
||||
#{safetyStock,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="model != null">
|
||||
#{model,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
#{standard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="color != null">
|
||||
#{color,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unit != null">
|
||||
#{unit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
#{unitId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
#{otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
#{otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
#{otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enableSerialNumber != null">
|
||||
#{enableSerialNumber,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.MaterialExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.categoryId != null">
|
||||
category_id = #{record.categoryId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.mfrs != null">
|
||||
mfrs = #{record.mfrs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.safetyStock != null">
|
||||
safety_stock = #{record.safetyStock,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.model != null">
|
||||
model = #{record.model,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.standard != null">
|
||||
standard = #{record.standard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.color != null">
|
||||
color = #{record.color,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.unit != null">
|
||||
unit = #{record.unit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.unitId != null">
|
||||
unit_id = #{record.unitId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.otherField1 != null">
|
||||
other_field1 = #{record.otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField2 != null">
|
||||
other_field2 = #{record.otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherField3 != null">
|
||||
other_field3 = #{record.otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update jsh_material
|
||||
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}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Material">
|
||||
update jsh_material
|
||||
<set>
|
||||
<if test="categoryId != null">
|
||||
category_id = #{categoryId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mfrs != null">
|
||||
mfrs = #{mfrs,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="safetyStock != null">
|
||||
safety_stock = #{safetyStock,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="model != null">
|
||||
model = #{model,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
standard = #{standard,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="color != null">
|
||||
color = #{color,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unit != null">
|
||||
unit = #{unit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="unitId != null">
|
||||
unit_id = #{unitId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="otherField1 != null">
|
||||
other_field1 = #{otherField1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField2 != null">
|
||||
other_field2 = #{otherField2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherField3 != null">
|
||||
other_field3 = #{otherField3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<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},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Material">
|
||||
update jsh_material
|
||||
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}
|
||||
</update>
|
||||
</mapper>
|
||||
296
jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml
Normal file
296
jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml
Normal file
@@ -0,0 +1,296 @@
|
||||
<?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.MaterialMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap" id="ResultMapList" type="com.jsh.erp.datasource.entities.MaterialVo4Unit">
|
||||
<result column="unitName" jdbcType="VARCHAR" property="unitName" />
|
||||
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
|
||||
<result column="bar_code" jdbcType="VARCHAR" property="mBarCode" />
|
||||
<result column="commodity_unit" jdbcType="VARCHAR" property="commodityUnit" />
|
||||
<result column="purchase_decimal" jdbcType="VARCHAR" property="purchaseDecimal" />
|
||||
<result column="commodity_decimal" jdbcType="VARCHAR" property="commodityDecimal" />
|
||||
<result column="wholesale_decimal" jdbcType="VARCHAR" property="wholesaleDecimal" />
|
||||
<result column="low_decimal" jdbcType="VARCHAR" property="lowDecimal" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.MaterialMapper.BaseResultMap" id="ResultAndUnitMap" type="com.jsh.erp.datasource.entities.MaterialVo4Unit">
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionMaterial" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
select m.*,u.name unitName, mc.name categoryName, me.bar_code,
|
||||
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.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.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
order by m.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countsByMaterial" resultType="java.lang.Long">
|
||||
SELECT
|
||||
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.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.delete_Flag,'0') !='1'
|
||||
WHERE 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findUnitList" resultType="com.jsh.erp.datasource.entities.Unit">
|
||||
select u.* from jsh_unit u
|
||||
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'
|
||||
</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.unit_id=u.id and ifnull(u.delete_flag,'0') !='1'
|
||||
where m.id = ${id}
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByIdWithBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
|
||||
select m.*,u.name unit_name,me.bar_code m_bar_code, me.commodity_unit, 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.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where me.id = ${meId}
|
||||
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,mc.name categoryName,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.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.delete_Flag,'0') !='1'
|
||||
where m.enabled=1 and me.id is not null
|
||||
<if test="q != null and q !=''">
|
||||
<bind name="bindKey" value="'%'+q+'%'"/>
|
||||
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
ORDER BY id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<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.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>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
select m.*,u.name unitName, mc.name categoryName,me.commodity_unit,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.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.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and me.default_flag=1
|
||||
<if test="barCode != null">
|
||||
and me.bar_code like '%${barCode}%'
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
</if>
|
||||
<if test="standard != null">
|
||||
and m.standard like '%${standard}%'
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
</if>
|
||||
<if test="idList.size()>0">
|
||||
and m.category_id in
|
||||
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
order by m.id desc
|
||||
</select>
|
||||
<select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material">
|
||||
select m.*
|
||||
FROM jsh_material m
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and m.name =#{name}
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getMaterialEnableSerialNumberList" parameterType="java.util.Map" resultMap="ResultAndUnitMap">
|
||||
select m.*,me.bar_code m_bar_code from jsh_material m
|
||||
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and m.enabled=1
|
||||
and m.enable_serial_number ='1'
|
||||
<if test="q != null and q !=''">
|
||||
<bind name="bindKey" value="'%'+q+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
order by m.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMaterialEnableSerialNumberCount" resultType="java.lang.Long">
|
||||
select count(me.id) from jsh_material m
|
||||
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
and m.enabled ='1'
|
||||
and m.enable_serial_number ='1'
|
||||
<if test="q != null and q !=''">
|
||||
<bind name="bindKey" value="'%'+q+'%'"/>
|
||||
and (m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
||||
</if>
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<update id="batchDeleteMaterialByIds">
|
||||
update jsh_material
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<select id="getMaterialListByCategoryIds" 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 category_id in (
|
||||
<foreach collection="categoryIds" item="categoryId" separator=",">
|
||||
#{categoryId}
|
||||
</foreach>
|
||||
)
|
||||
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 unit_id in (
|
||||
<foreach collection="unitIds" item="unitId" separator=",">
|
||||
#{unitId}
|
||||
</foreach>
|
||||
)
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getMaxBarCode" resultType="java.lang.String">
|
||||
select max(CAST(l.bar_code AS SIGNED)) bar_code from jsh_material_extend l
|
||||
where 1=1
|
||||
and ifnull(l.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="getMaterialByMeId" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
select m.*,me.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.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.delete_Flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="meId != null">
|
||||
and me.id = ${meId}
|
||||
</if>
|
||||
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'
|
||||
group by m.name
|
||||
order by m.name asc
|
||||
</select>
|
||||
|
||||
<select id="getMaterialByBarCode" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
|
||||
select m.*,u.name unit_name,me.bar_code m_bar_code, me.commodity_unit, 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.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where me.bar_code = #{barCode}
|
||||
and ifnull(m.delete_flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<update id="setUnitIdToNull">
|
||||
update jsh_material
|
||||
set unit_id = null
|
||||
where 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
and id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,228 @@
|
||||
<?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.MaterialPropertyMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.MaterialProperty">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="native_name" jdbcType="VARCHAR" property="nativeName" />
|
||||
<result column="enabled" jdbcType="BIT" property="enabled" />
|
||||
<result column="sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="another_name" jdbcType="VARCHAR" property="anotherName" />
|
||||
<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, native_name, enabled, sort, another_name, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_material_property
|
||||
<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_material_property
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_material_property
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample">
|
||||
delete from jsh_material_property
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.MaterialProperty">
|
||||
insert into jsh_material_property (id, native_name, enabled,
|
||||
sort, another_name, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{nativeName,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
|
||||
#{sort,jdbcType=VARCHAR}, #{anotherName,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.MaterialProperty">
|
||||
insert into jsh_material_property
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="nativeName != null">
|
||||
native_name,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
<if test="anotherName != null">
|
||||
another_name,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="nativeName != null">
|
||||
#{nativeName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="anotherName != null">
|
||||
#{anotherName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_material_property
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_material_property
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.nativeName != null">
|
||||
native_name = #{record.nativeName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.anotherName != null">
|
||||
another_name = #{record.anotherName,jdbcType=VARCHAR},
|
||||
</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_material_property
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
native_name = #{record.nativeName,jdbcType=VARCHAR},
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
another_name = #{record.anotherName,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.MaterialProperty">
|
||||
update jsh_material_property
|
||||
<set>
|
||||
<if test="nativeName != null">
|
||||
native_name = #{nativeName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="anotherName != null">
|
||||
another_name = #{anotherName,jdbcType=VARCHAR},
|
||||
</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.MaterialProperty">
|
||||
update jsh_material_property
|
||||
set native_name = #{nativeName,jdbcType=VARCHAR},
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
another_name = #{anotherName,jdbcType=VARCHAR},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.MaterialPropertyMapperEx">
|
||||
<select id="selectByConditionMaterialProperty" parameterType="com.jsh.erp.datasource.entities.MaterialPropertyExample" resultMap="com.jsh.erp.datasource.mappers.MaterialPropertyMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_material_property
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and native_name like '%${name}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByMaterialProperty" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_material_property
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and native_name like '%${name}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteMaterialPropertyByIds">
|
||||
update jsh_material_property
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
318
jshERP-boot/src/main/resources/mapper_xml/MsgMapper.xml
Normal file
318
jshERP-boot/src/main/resources/mapper_xml/MsgMapper.xml
Normal file
@@ -0,0 +1,318 @@
|
||||
<?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.MsgMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="msg_title" property="msgTitle" jdbcType="VARCHAR" />
|
||||
<result column="msg_content" property="msgContent" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="type" property="type" jdbcType="VARCHAR" />
|
||||
<result column="status" property="status" jdbcType="VARCHAR" />
|
||||
<result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
|
||||
<result column="delete_Flag" property="deleteFlag" jdbcType="VARCHAR" />
|
||||
</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="(" suffix=")" prefixOverrides="and" >
|
||||
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
|
||||
<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 collection="criterion.value" item="listItem" open="(" close=")" 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, msg_title, msg_content, create_time, type, status, tenant_id, delete_Flag
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
|
||||
<!--
|
||||
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_msg
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_msg
|
||||
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_msg
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_msg
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_msg (id, msg_title, msg_content,
|
||||
create_time, type, status,
|
||||
tenant_id, delete_Flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_msg
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="msgTitle != null" >
|
||||
msg_title,
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
msg_content,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</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="msgTitle != null" >
|
||||
#{msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
#{msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,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.MsgExample" resultType="java.lang.Integer" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_msg
|
||||
<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_msg
|
||||
<set >
|
||||
<if test="record.id != null" >
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.msgTitle != null" >
|
||||
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.msgContent != null" >
|
||||
msg_content = #{record.msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null" >
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.type != null" >
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null" >
|
||||
status = #{record.status,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_msg
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
|
||||
msg_content = #{record.msgContent,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
status = #{record.status,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.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
<set >
|
||||
<if test="msgTitle != null" >
|
||||
msg_title = #{msgTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="msgContent != null" >
|
||||
msg_content = #{msgContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null" >
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status = #{status,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.Msg" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_msg
|
||||
set msg_title = #{msgTitle,jdbcType=VARCHAR},
|
||||
msg_content = #{msgContent,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
71
jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml
Normal file
71
jshERP-boot/src/main/resources/mapper_xml/MsgMapperEx.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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.MsgMapperEx">
|
||||
<select id="selectByConditionMsg" resultMap="com.jsh.erp.datasource.mappers.MsgMapper.BaseResultMap">
|
||||
SELECT *
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
</if>
|
||||
order by create_time desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>;
|
||||
</select>
|
||||
<select id="countsByMsg" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and msg_title like '%${name}%'
|
||||
</if>
|
||||
</select>
|
||||
<update id="batchDeleteMsgByIds">
|
||||
update jsh_msg
|
||||
set delete_Flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
<insert id="insertSelectiveByTask" parameterType="com.jsh.erp.datasource.entities.Msg">
|
||||
insert into jsh_msg(msg_title,msg_content,create_time,type,status,tenant_id)
|
||||
values (
|
||||
#{msgTitle,jdbcType=VARCHAR},
|
||||
#{msgContent,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{type,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="checkIsNameExistByTask" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="msgTitle != null">
|
||||
and msg_title = '${msgTitle}'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getMsgCountByStatus" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_msg
|
||||
WHERE 1=1
|
||||
and ifnull(delete_Flag,'0') !='1'
|
||||
<if test="status != null">
|
||||
and status = '${status}'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
351
jshERP-boot/src/main/resources/mapper_xml/OrgaUserRelMapper.xml
Normal file
351
jshERP-boot/src/main/resources/mapper_xml/OrgaUserRelMapper.xml
Normal file
@@ -0,0 +1,351 @@
|
||||
<?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.OrgaUserRelMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.OrgaUserRel">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="orga_id" jdbcType="BIGINT" property="orgaId" />
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
||||
<result column="user_blng_orga_dspl_seq" jdbcType="VARCHAR" property="userBlngOrgaDsplSeq" />
|
||||
<result column="delete_flag" jdbcType="CHAR" property="deleteFlag" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="creator" jdbcType="BIGINT" property="creator" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="updater" jdbcType="BIGINT" property="updater" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</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, orga_id, user_id, user_blng_orga_dspl_seq, delete_flag, create_time, creator,
|
||||
update_time, updater, tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.OrgaUserRelExample" 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_orga_user_rel
|
||||
<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_orga_user_rel
|
||||
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_orga_user_rel
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.OrgaUserRelExample">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_orga_user_rel
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_orga_user_rel (id, orga_id, user_id,
|
||||
user_blng_orga_dspl_seq, delete_flag, create_time,
|
||||
creator, update_time, updater,
|
||||
tenant_id)
|
||||
values (#{id,jdbcType=BIGINT}, #{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
|
||||
#{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT},
|
||||
#{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_orga_user_rel
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="orgaId != null">
|
||||
orga_id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="userBlngOrgaDsplSeq != null">
|
||||
user_blng_orga_dspl_seq,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="orgaId != null">
|
||||
#{orgaId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userBlngOrgaDsplSeq != null">
|
||||
#{userBlngOrgaDsplSeq,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
#{updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.OrgaUserRelExample" resultType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_orga_user_rel
|
||||
<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_orga_user_rel
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.orgaId != null">
|
||||
orga_id = #{record.orgaId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.userBlngOrgaDsplSeq != null">
|
||||
user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.deleteFlag != null">
|
||||
delete_flag = #{record.deleteFlag,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.creator != null">
|
||||
creator = #{record.creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updater != null">
|
||||
updater = #{record.updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</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_orga_user_rel
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
orga_id = #{record.orgaId,jdbcType=BIGINT},
|
||||
user_id = #{record.userId,jdbcType=BIGINT},
|
||||
user_blng_orga_dspl_seq = #{record.userBlngOrgaDsplSeq,jdbcType=VARCHAR},
|
||||
delete_flag = #{record.deleteFlag,jdbcType=CHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
creator = #{record.creator,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
updater = #{record.updater,jdbcType=BIGINT},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_orga_user_rel
|
||||
<set>
|
||||
<if test="orgaId != null">
|
||||
orga_id = #{orgaId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="userBlngOrgaDsplSeq != null">
|
||||
user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag = #{deleteFlag,jdbcType=CHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel">
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_orga_user_rel
|
||||
set orga_id = #{orgaId,jdbcType=BIGINT},
|
||||
user_id = #{userId,jdbcType=BIGINT},
|
||||
user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq,jdbcType=VARCHAR},
|
||||
delete_flag = #{deleteFlag,jdbcType=CHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
updater = #{updater,jdbcType=BIGINT},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.OrgaUserRelMapperEx" >
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.OrgaUserRelMapper.BaseResultMap" id="BaseResultMapEx" type="com.jsh.erp.datasource.entities.OrgaUserRelEx" >
|
||||
</resultMap>
|
||||
<insert id="addOrgaUserRel" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel"
|
||||
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into jsh_orga_user_rel (orga_id, user_id,
|
||||
user_blng_orga_dspl_seq, delete_flag, create_time,
|
||||
creator, update_time, updater
|
||||
)
|
||||
values (#{orgaId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
|
||||
#{userBlngOrgaDsplSeq,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=BIGINT}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateOrgaUserRel" parameterType="com.jsh.erp.datasource.entities.OrgaUserRel" >
|
||||
update jsh_orga_user_rel
|
||||
<set >
|
||||
<if test="orgaId != null" >
|
||||
orga_id = #{orgaId},
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="userBlngOrgaDsplSeq != null" >
|
||||
user_blng_orga_dspl_seq = #{userBlngOrgaDsplSeq},
|
||||
</if>
|
||||
<if test="deleteFlag != null" >
|
||||
delete_flag = #{deleteFlag},
|
||||
</if>
|
||||
<if test="updateTime != null" >
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="updater != null" >
|
||||
updater = #{updater},
|
||||
</if>
|
||||
</set>
|
||||
where 1=1
|
||||
and id=#{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
306
jshERP-boot/src/main/resources/mapper_xml/OrganizationMapper.xml
Normal file
306
jshERP-boot/src/main/resources/mapper_xml/OrganizationMapper.xml
Normal file
@@ -0,0 +1,306 @@
|
||||
<?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.OrganizationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Organization">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="org_no" jdbcType="VARCHAR" property="orgNo" />
|
||||
<result column="org_full_name" jdbcType="VARCHAR" property="orgFullName" />
|
||||
<result column="org_abr" jdbcType="VARCHAR" property="orgAbr" />
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
|
||||
<result column="sort" jdbcType="VARCHAR" property="sort" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<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, org_no, org_full_name, org_abr, parent_id, sort, remark, create_time, update_time,
|
||||
tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.OrganizationExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_organization
|
||||
<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_organization
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_organization
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.OrganizationExample">
|
||||
delete from jsh_organization
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Organization">
|
||||
insert into jsh_organization (id, org_no, org_full_name,
|
||||
org_abr, parent_id, sort,
|
||||
remark, create_time, update_time,
|
||||
tenant_id, delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{orgNo,jdbcType=VARCHAR}, #{orgFullName,jdbcType=VARCHAR},
|
||||
#{orgAbr,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR},
|
||||
#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Organization">
|
||||
insert into jsh_organization
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="orgNo != null">
|
||||
org_no,
|
||||
</if>
|
||||
<if test="orgFullName != null">
|
||||
org_full_name,
|
||||
</if>
|
||||
<if test="orgAbr != null">
|
||||
org_abr,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</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="orgNo != null">
|
||||
#{orgNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orgFullName != null">
|
||||
#{orgFullName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orgAbr != null">
|
||||
#{orgAbr,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
#{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</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.OrganizationExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_organization
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_organization
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.orgNo != null">
|
||||
org_no = #{record.orgNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.orgFullName != null">
|
||||
org_full_name = #{record.orgFullName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.orgAbr != null">
|
||||
org_abr = #{record.orgAbr,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.parentId != null">
|
||||
parent_id = #{record.parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.sort != null">
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</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_organization
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
org_no = #{record.orgNo,jdbcType=VARCHAR},
|
||||
org_full_name = #{record.orgFullName,jdbcType=VARCHAR},
|
||||
org_abr = #{record.orgAbr,jdbcType=VARCHAR},
|
||||
parent_id = #{record.parentId,jdbcType=BIGINT},
|
||||
sort = #{record.sort,jdbcType=VARCHAR},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
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.Organization">
|
||||
update jsh_organization
|
||||
<set>
|
||||
<if test="orgNo != null">
|
||||
org_no = #{orgNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orgFullName != null">
|
||||
org_full_name = #{orgFullName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orgAbr != null">
|
||||
org_abr = #{orgAbr,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</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.Organization">
|
||||
update jsh_organization
|
||||
set org_no = #{orgNo,jdbcType=VARCHAR},
|
||||
org_full_name = #{orgFullName,jdbcType=VARCHAR},
|
||||
org_abr = #{orgAbr,jdbcType=VARCHAR},
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
sort = #{sort,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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.OrganizationMapperEx">
|
||||
|
||||
<resultMap id="BaseTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
|
||||
<result column="id" property="id"/>
|
||||
<result column="id" property="key"/>
|
||||
<result column="id" property="value"/>
|
||||
<result column="org_abr" property="title"/>
|
||||
<result column="org_no" property="attributes"/>
|
||||
<collection column="{currentId=currentId,org_no=org_no,id=id}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="NextTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
|
||||
<result column="id" property="id"/>
|
||||
<result column="id" property="key"/>
|
||||
<result column="id" property="value"/>
|
||||
<result column="org_abr" property="title"/>
|
||||
<result column="org_no" property="attributes"/>
|
||||
<collection column="{currentId=currentId,org_no=org_no,id=id}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, org_abr,org_no
|
||||
</sql>
|
||||
|
||||
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>,#{currentId} as currentId
|
||||
FROM jsh_organization
|
||||
WHERE parent_id = #{id}
|
||||
<if test="currentId != null">
|
||||
and id !=#{currentId}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="getNodeTree" resultMap="BaseTreeResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>,#{currentId} as currentId
|
||||
FROM jsh_organization
|
||||
WHERE parent_id is null
|
||||
<if test="currentId != null">
|
||||
and id !=#{currentId}
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by sort asc
|
||||
</select>
|
||||
<insert id="addOrganization" parameterType="com.jsh.erp.datasource.entities.Organization"
|
||||
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into jsh_organization
|
||||
(org_no, org_full_name,
|
||||
org_abr, delete_flag,
|
||||
parent_id, sort, remark,
|
||||
create_time, update_time)
|
||||
values
|
||||
(#{orgNo,jdbcType=VARCHAR}, #{orgFullName,jdbcType=VARCHAR},
|
||||
#{orgAbr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=CHAR},
|
||||
#{parentId,jdbcType=BIGINT}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<update id="batchDeleteOrganizationByIds">
|
||||
update jsh_organization
|
||||
set update_Time=#{updateTime},delete_flag='1'
|
||||
where id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<update id="editOrganization">
|
||||
update jsh_organization
|
||||
set update_time=#{updateTime},
|
||||
org_no = #{orgNo},org_full_name = #{orgFullName},
|
||||
org_abr = #{orgAbr},
|
||||
delete_flag = #{deleteFlag},parent_id = #{parentId},
|
||||
sort = #{sort},remark = #{remark}
|
||||
where id =#{id}
|
||||
</update>
|
||||
|
||||
<select id="getOrganizationRootByIds" resultMap="com.jsh.erp.datasource.mappers.OrganizationMapper.BaseResultMap">
|
||||
select * from jsh_organization
|
||||
where
|
||||
1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
and parent_id is null
|
||||
and org_abr='根机构'
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
211
jshERP-boot/src/main/resources/mapper_xml/PersonMapper.xml
Normal file
211
jshERP-boot/src/main/resources/mapper_xml/PersonMapper.xml
Normal file
@@ -0,0 +1,211 @@
|
||||
<?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.PersonMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Person">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<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, name, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.PersonExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_person
|
||||
<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_person
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_person
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.PersonExample">
|
||||
delete from jsh_person
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Person">
|
||||
insert into jsh_person (id, type, name,
|
||||
tenant_id, delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Person">
|
||||
insert into jsh_person
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</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="name != null">
|
||||
#{name,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.PersonExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_person
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_person
|
||||
<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.name != null">
|
||||
name = #{record.name,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_person
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
name = #{record.name,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.Person">
|
||||
update jsh_person
|
||||
<set>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,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.Person">
|
||||
update jsh_person
|
||||
set type = #{type,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
42
jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml
Normal file
42
jshERP-boot/src/main/resources/mapper_xml/PersonMapperEx.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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.PersonMapperEx">
|
||||
<select id="selectByConditionPerson" parameterType="com.jsh.erp.datasource.entities.PersonExample" resultMap="com.jsh.erp.datasource.mappers.PersonMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_person
|
||||
where 1=1
|
||||
<if test="name != null and name != ''">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type='${type}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByPerson" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_person
|
||||
WHERE 1=1
|
||||
<if test="name != null and name != ''">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and type='${type}'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeletePersonByIds">
|
||||
update jsh_person
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,196 @@
|
||||
<?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.PlatformConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.PlatformConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="platform_key" jdbcType="VARCHAR" property="platformKey" />
|
||||
<result column="platform_key_info" jdbcType="VARCHAR" property="platformKeyInfo" />
|
||||
<result column="platform_value" jdbcType="VARCHAR" property="platformValue" />
|
||||
</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, platform_key, platform_key_info, platform_value
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.PlatformConfigExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_platform_config
|
||||
<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_platform_config
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_platform_config
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.PlatformConfigExample">
|
||||
delete from jsh_platform_config
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.PlatformConfig">
|
||||
insert into jsh_platform_config (id, platform_key, platform_key_info,
|
||||
platform_value)
|
||||
values (#{id,jdbcType=BIGINT}, #{platformKey,jdbcType=VARCHAR}, #{platformKeyInfo,jdbcType=VARCHAR},
|
||||
#{platformValue,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.PlatformConfig">
|
||||
insert into jsh_platform_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="platformKey != null">
|
||||
platform_key,
|
||||
</if>
|
||||
<if test="platformKeyInfo != null">
|
||||
platform_key_info,
|
||||
</if>
|
||||
<if test="platformValue != null">
|
||||
platform_value,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="platformKey != null">
|
||||
#{platformKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platformKeyInfo != null">
|
||||
#{platformKeyInfo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platformValue != null">
|
||||
#{platformValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.PlatformConfigExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_platform_config
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_platform_config
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.platformKey != null">
|
||||
platform_key = #{record.platformKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.platformKeyInfo != null">
|
||||
platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.platformValue != null">
|
||||
platform_value = #{record.platformValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update jsh_platform_config
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
platform_key = #{record.platformKey,jdbcType=VARCHAR},
|
||||
platform_key_info = #{record.platformKeyInfo,jdbcType=VARCHAR},
|
||||
platform_value = #{record.platformValue,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.PlatformConfig">
|
||||
update jsh_platform_config
|
||||
<set>
|
||||
<if test="platformKey != null">
|
||||
platform_key = #{platformKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platformKeyInfo != null">
|
||||
platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platformValue != null">
|
||||
platform_value = #{platformValue,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.PlatformConfig">
|
||||
update jsh_platform_config
|
||||
set platform_key = #{platformKey,jdbcType=VARCHAR},
|
||||
platform_key_info = #{platformKeyInfo,jdbcType=VARCHAR},
|
||||
platform_value = #{platformValue,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
243
jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml
Normal file
243
jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml
Normal file
@@ -0,0 +1,243 @@
|
||||
<?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.RoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Role">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="value" jdbcType="VARCHAR" property="value" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<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, name, type, value, description, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.RoleExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_role
|
||||
<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_role
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_role
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.RoleExample">
|
||||
delete from jsh_role
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Role">
|
||||
insert into jsh_role (id, name, type,
|
||||
value, description, tenant_id,
|
||||
delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||
#{value,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT},
|
||||
#{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Role">
|
||||
insert into jsh_role
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</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="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
#{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,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.RoleExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_role
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_role
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.value != null">
|
||||
value = #{record.value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,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_role
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
value = #{record.value,jdbcType=VARCHAR},
|
||||
description = #{record.description,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.Role">
|
||||
update jsh_role
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value = #{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,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.Role">
|
||||
update jsh_role
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
value = #{value,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
36
jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml
Normal file
36
jshERP-boot/src/main/resources/mapper_xml/RoleMapperEx.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.RoleMapperEx">
|
||||
<select id="selectByConditionRole" resultMap="com.jsh.erp.datasource.mappers.RoleMapper.BaseResultMap">
|
||||
SELECT *
|
||||
FROM jsh_role
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>;
|
||||
</select>
|
||||
<select id="countsByRole" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_role
|
||||
WHERE 1=1
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
</select>
|
||||
<update id="batchDeleteRoleByIds">
|
||||
update jsh_role
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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.SequenceMapperEx">
|
||||
|
||||
<update id="updateBuildOnlyNumber">
|
||||
update jsh_sequence set current_val = current_val + 1 where seq_name = 'depot_number_seq'
|
||||
</update>
|
||||
|
||||
<select id="getBuildOnlyNumber" resultType="java.lang.Long">
|
||||
select current_val from jsh_sequence where seq_name = 'depot_number_seq'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
323
jshERP-boot/src/main/resources/mapper_xml/SerialNumberMapper.xml
Normal file
323
jshERP-boot/src/main/resources/mapper_xml/SerialNumberMapper.xml
Normal file
@@ -0,0 +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.SerialNumberMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.SerialNumber">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="material_id" jdbcType="BIGINT" property="materialId" />
|
||||
<result column="serial_number" jdbcType="VARCHAR" property="serialNumber" />
|
||||
<result column="is_sell" jdbcType="VARCHAR" property="isSell" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="creator" jdbcType="BIGINT" property="creator" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="updater" jdbcType="BIGINT" property="updater" />
|
||||
<result column="depot_head_id" jdbcType="BIGINT" property="depotHeadId" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</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, material_id, serial_number, is_sell, remark, delete_flag, create_time, creator,
|
||||
update_time, updater, depot_head_id, tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SerialNumberExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_serial_number
|
||||
<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_serial_number
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_serial_number
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SerialNumberExample">
|
||||
delete from jsh_serial_number
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.SerialNumber">
|
||||
insert into jsh_serial_number (id, material_id, serial_number,
|
||||
is_sell, remark, delete_flag,
|
||||
create_time, creator, update_time,
|
||||
updater, depot_head_id, tenant_id
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT}, #{serialNumber,jdbcType=VARCHAR},
|
||||
#{isSell,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP},
|
||||
#{updater,jdbcType=BIGINT}, #{depotHeadId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SerialNumber">
|
||||
insert into jsh_serial_number
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
material_id,
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
serial_number,
|
||||
</if>
|
||||
<if test="isSell != null">
|
||||
is_sell,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater,
|
||||
</if>
|
||||
<if test="depotHeadId != null">
|
||||
depot_head_id,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="materialId != null">
|
||||
#{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
#{serialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isSell != null">
|
||||
#{isSell,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
#{updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotHeadId != null">
|
||||
#{depotHeadId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SerialNumberExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_serial_number
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_serial_number
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.materialId != null">
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.serialNumber != null">
|
||||
serial_number = #{record.serialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isSell != null">
|
||||
is_sell = #{record.isSell,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.deleteFlag != null">
|
||||
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.creator != null">
|
||||
creator = #{record.creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updater != null">
|
||||
updater = #{record.updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.depotHeadId != null">
|
||||
depot_head_id = #{record.depotHeadId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update jsh_serial_number
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
material_id = #{record.materialId,jdbcType=BIGINT},
|
||||
serial_number = #{record.serialNumber,jdbcType=VARCHAR},
|
||||
is_sell = #{record.isSell,jdbcType=VARCHAR},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
creator = #{record.creator,jdbcType=BIGINT},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
updater = #{record.updater,jdbcType=BIGINT},
|
||||
depot_head_id = #{record.depotHeadId,jdbcType=BIGINT},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.SerialNumber">
|
||||
update jsh_serial_number
|
||||
<set>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isSell != null">
|
||||
is_sell = #{isSell,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotHeadId != null">
|
||||
depot_head_id = #{depotHeadId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.SerialNumber">
|
||||
update jsh_serial_number
|
||||
set material_id = #{materialId,jdbcType=BIGINT},
|
||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||
is_sell = #{isSell,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
creator = #{creator,jdbcType=BIGINT},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
updater = #{updater,jdbcType=BIGINT},
|
||||
depot_head_id = #{depotHeadId,jdbcType=BIGINT},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,247 @@
|
||||
<?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.SerialNumberMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.SerialNumberMapper.BaseResultMap" id="SerialNumberExBaseResultMap" type="com.jsh.erp.datasource.entities.SerialNumberEx">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="materialCode" jdbcType="VARCHAR" property="materialCode" />
|
||||
<result column="materialName" jdbcType="VARCHAR" property="materialName" />
|
||||
<result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
|
||||
<result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
|
||||
<result column="depotHeadNumber" jdbcType="VARCHAR" property="depotHeadNumber" />
|
||||
<result column="depotHeadType" jdbcType="VARCHAR" property="depotHeadType" />
|
||||
</resultMap>
|
||||
<select id="selectByConditionSerialNumber" resultMap="SerialNumberExBaseResultMap">
|
||||
select
|
||||
ser.id, ser.material_id, ser.serial_number, ser.is_sell, ser.remark, ser.delete_flag, ser.create_time,
|
||||
ser.update_time,me.bar_code as materialCode,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.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_material_extend me on mat.id=me.material_id and ifnull(me.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 + '%'" />
|
||||
and ser.serial_number like #{serialNumber}
|
||||
</if>
|
||||
<if test="materialName != null">
|
||||
<bind name="materialName" value="'%' + _parameter.materialName + '%'" />
|
||||
and mat.name like #{materialName}
|
||||
</if>
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
order by ser.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countSerialNumber" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(ser.id)
|
||||
FROM jsh_serial_number ser
|
||||
left JOIN jsh_material mat on mat.id = ser.material_Id and ifnull(mat.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
<if test="serialNumber != null">
|
||||
<bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" />
|
||||
and ser.serial_Number like #{serialNumber}
|
||||
</if>
|
||||
<if test="materialName != null">
|
||||
<bind name="materialName" value="'%' + _parameter.materialName + '%'" />
|
||||
and mat.name like #{materialName}
|
||||
</if>
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
order by ser.id desc
|
||||
</select>
|
||||
<select id="findById" resultMap="SerialNumberExBaseResultMap">
|
||||
SELECT
|
||||
ser.id, ser.material_id, ser.serial_number, ser.is_sell, ser.remark, ser.delete_flag, ser.create_time,
|
||||
ser.update_time,ser.creator,ser.updater,mat.name as materialName,cr.username as creatorName,
|
||||
ur.username as updaterName,ser.depot_head_id
|
||||
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_user cr on ser.creator=cr.id and ifnull(cr.status,'0') not in('1','2')
|
||||
left join jsh_user ur on ser.updater=ur.id and ifnull(ur.status,'0') not in('1','2')
|
||||
where 1=1
|
||||
and ser.id=#{id}
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
order by ser.id desc
|
||||
</select>
|
||||
<select id="findBySerialNumber" resultMap="SerialNumberExBaseResultMap">
|
||||
SELECT
|
||||
ser.id, ser.material_id, ser.serial_number, ser.is_sell, ser.remark, ser.delete_flag, ser.create_time,
|
||||
ser.update_time,ser.creator,ser.updater,ser.depot_head_id
|
||||
FROM jsh_serial_number ser
|
||||
where 1=1
|
||||
<if test="serialNumber != null">
|
||||
and ser.serial_number=#{serialNumber}
|
||||
</if>
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
order by ser.id desc
|
||||
</select>
|
||||
<insert id="addSerialNumber" parameterType="com.jsh.erp.datasource.entities.SerialNumberEx"
|
||||
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into jsh_serial_number
|
||||
(material_id, serial_number, is_sell, remark,delete_flag,
|
||||
create_time, creator,update_time, updater,depot_head_id)
|
||||
values
|
||||
(#{materialId},#{serialNumber},#{isSell},#{remark},#{deleteFlag},
|
||||
#{createTime},#{creator},#{updateTime},#{updater},#{depotHeadId}
|
||||
)
|
||||
</insert>
|
||||
<update id="updateSerialNumber" parameterType="com.jsh.erp.datasource.entities.SerialNumberEx">
|
||||
update jsh_serial_number
|
||||
<set>
|
||||
<if test="materialId != null">
|
||||
material_id = #{materialId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="serialNumber != null">
|
||||
serial_number = #{serialNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isSell != null">
|
||||
is_sell = #{isSell,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="depotHeadId != null">
|
||||
depot_head_id = #{depotHeadId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="findSerialNumberByMaterialId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(ser.id)
|
||||
FROM jsh_serial_number ser
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and ser.material_Id=#{materialId}
|
||||
</if>
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
and ser.is_sell !='1'
|
||||
</select>
|
||||
<select id="countSerialNumberByMaterialIdAndDepotheadId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(ser.id)
|
||||
FROM jsh_serial_number ser
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and ser.material_id=#{materialId}
|
||||
</if>
|
||||
<if test="depotHeadId != null">
|
||||
and ser.depot_head_id=#{depotHeadId}
|
||||
</if>
|
||||
and ser.is_sell =#{isSell,jdbcType=VARCHAR}
|
||||
and ifnull(ser.delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="sellSerialNumber">
|
||||
update jsh_serial_number
|
||||
<set>
|
||||
is_sell = '1',
|
||||
<if test="depotHeadId !=null ">
|
||||
depot_head_id = #{depotHeadId},
|
||||
</if>
|
||||
<if test="updateTime !=null ">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
</set>
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and material_id = #{materialId}
|
||||
</if>
|
||||
and is_sell != '1'
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="count != null">
|
||||
and id in
|
||||
( select batchSN.id from
|
||||
( select selFrom.id from jsh_serial_number selFrom
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and selFrom.material_Id = #{materialId}
|
||||
</if>
|
||||
and selFrom.is_sell != '1'
|
||||
and ifnull(selFrom.delete_flag,'0') !='1'
|
||||
limit 0,#{count}
|
||||
) batchSN
|
||||
)
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<update id="cancelSerialNumber">
|
||||
update jsh_serial_number
|
||||
<set>
|
||||
is_sell = '0', depot_head_id=null,
|
||||
<if test="updateTime !=null ">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="updater != null">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
</set>
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and material_id = #{materialId}
|
||||
</if>
|
||||
<if test="depotHeadId !=null ">
|
||||
and depot_head_id = #{depotHeadId,jdbcType=BIGINT}
|
||||
</if>
|
||||
and is_sell != '0'
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="count != null">
|
||||
and id in
|
||||
( select batchSN.id from
|
||||
( select selFrom.id from jsh_serial_number selFrom
|
||||
where 1=1
|
||||
<if test="materialId != null">
|
||||
and selFrom.material_id = #{materialId}
|
||||
</if>
|
||||
<if test="depotHeadId !=null ">
|
||||
and selFrom.depot_head_id = #{depotHeadId,jdbcType=BIGINT}
|
||||
</if>
|
||||
and selFrom.is_sell !='0'
|
||||
and ifnull(selFrom.delete_flag,'0') !='1'
|
||||
limit 0,#{count}
|
||||
) batchSN
|
||||
)
|
||||
</if>
|
||||
</update>
|
||||
<insert id="batAddSerialNumber"
|
||||
useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
insert into jsh_serial_number
|
||||
(material_id, serial_number, is_sell, remark,delete_flag,
|
||||
create_time, creator,update_time, updater)
|
||||
values
|
||||
<foreach collection='list' item='each' separator=','>
|
||||
(#{each.materialId},#{each.serialNumber},'0',#{each.remark},'0',
|
||||
#{each.createTime},#{each.creator},#{each.updateTime},#{each.updater}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="batchDeleteSerialNumberByIds">
|
||||
update jsh_serial_number
|
||||
set update_time=#{updateTime},updater=#{updater},delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
495
jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml
Normal file
495
jshERP-boot/src/main/resources/mapper_xml/SupplierMapper.xml
Normal file
@@ -0,0 +1,495 @@
|
||||
<?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.SupplierMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Supplier">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="supplier" jdbcType="VARCHAR" property="supplier" />
|
||||
<result column="contacts" jdbcType="VARCHAR" property="contacts" />
|
||||
<result column="phone_num" jdbcType="VARCHAR" property="phoneNum" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="isystem" jdbcType="TINYINT" property="isystem" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="enabled" jdbcType="BIT" property="enabled" />
|
||||
<result column="advance_in" jdbcType="DECIMAL" property="advanceIn" />
|
||||
<result column="begin_need_get" jdbcType="DECIMAL" property="beginNeedGet" />
|
||||
<result column="begin_need_pay" jdbcType="DECIMAL" property="beginNeedPay" />
|
||||
<result column="all_need_get" jdbcType="DECIMAL" property="allNeedGet" />
|
||||
<result column="all_need_pay" jdbcType="DECIMAL" property="allNeedPay" />
|
||||
<result column="fax" jdbcType="VARCHAR" property="fax" />
|
||||
<result column="telephone" jdbcType="VARCHAR" property="telephone" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="tax_num" jdbcType="VARCHAR" property="taxNum" />
|
||||
<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
|
||||
<result column="account_number" jdbcType="VARCHAR" property="accountNumber" />
|
||||
<result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
|
||||
<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, supplier, contacts, phone_num, email, description, isystem, type, enabled, advance_in,
|
||||
begin_need_get, begin_need_pay, all_need_get, all_need_pay, fax, telephone, address,
|
||||
tax_num, bank_name, account_number, tax_rate, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_supplier
|
||||
<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_supplier
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_supplier
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SupplierExample">
|
||||
delete from jsh_supplier
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Supplier">
|
||||
insert into jsh_supplier (id, supplier, contacts,
|
||||
phone_num, email, description,
|
||||
isystem, type, enabled,
|
||||
advance_in, begin_need_get, begin_need_pay,
|
||||
all_need_get, all_need_pay, fax,
|
||||
telephone, address, tax_num,
|
||||
bank_name, account_number, tax_rate,
|
||||
tenant_id, delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{supplier,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
|
||||
#{phoneNum,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{isystem,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
|
||||
#{advanceIn,jdbcType=DECIMAL}, #{beginNeedGet,jdbcType=DECIMAL}, #{beginNeedPay,jdbcType=DECIMAL},
|
||||
#{allNeedGet,jdbcType=DECIMAL}, #{allNeedPay,jdbcType=DECIMAL}, #{fax,jdbcType=VARCHAR},
|
||||
#{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{taxNum,jdbcType=VARCHAR},
|
||||
#{bankName,jdbcType=VARCHAR}, #{accountNumber,jdbcType=VARCHAR}, #{taxRate,jdbcType=DECIMAL},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Supplier">
|
||||
insert into jsh_supplier
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="supplier != null">
|
||||
supplier,
|
||||
</if>
|
||||
<if test="contacts != null">
|
||||
contacts,
|
||||
</if>
|
||||
<if test="phoneNum != null">
|
||||
phone_num,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
isystem,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled,
|
||||
</if>
|
||||
<if test="advanceIn != null">
|
||||
advance_in,
|
||||
</if>
|
||||
<if test="beginNeedGet != null">
|
||||
begin_need_get,
|
||||
</if>
|
||||
<if test="beginNeedPay != null">
|
||||
begin_need_pay,
|
||||
</if>
|
||||
<if test="allNeedGet != null">
|
||||
all_need_get,
|
||||
</if>
|
||||
<if test="allNeedPay != null">
|
||||
all_need_pay,
|
||||
</if>
|
||||
<if test="fax != null">
|
||||
fax,
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
telephone,
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address,
|
||||
</if>
|
||||
<if test="taxNum != null">
|
||||
tax_num,
|
||||
</if>
|
||||
<if test="bankName != null">
|
||||
bank_name,
|
||||
</if>
|
||||
<if test="accountNumber != null">
|
||||
account_number,
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate,
|
||||
</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="supplier != null">
|
||||
#{supplier,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="contacts != null">
|
||||
#{contacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phoneNum != null">
|
||||
#{phoneNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
#{isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
#{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="advanceIn != null">
|
||||
#{advanceIn,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="beginNeedGet != null">
|
||||
#{beginNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="beginNeedPay != null">
|
||||
#{beginNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allNeedGet != null">
|
||||
#{allNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allNeedPay != null">
|
||||
#{allNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="fax != null">
|
||||
#{fax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
#{telephone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
#{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taxNum != null">
|
||||
#{taxNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bankName != null">
|
||||
#{bankName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountNumber != null">
|
||||
#{accountNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
#{taxRate,jdbcType=DECIMAL},
|
||||
</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.SupplierExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_supplier
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_supplier
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.supplier != null">
|
||||
supplier = #{record.supplier,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.contacts != null">
|
||||
contacts = #{record.contacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.phoneNum != null">
|
||||
phone_num = #{record.phoneNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.email != null">
|
||||
email = #{record.email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isystem != null">
|
||||
isystem = #{record.isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.enabled != null">
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="record.advanceIn != null">
|
||||
advance_in = #{record.advanceIn,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.beginNeedGet != null">
|
||||
begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.beginNeedPay != null">
|
||||
begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.allNeedGet != null">
|
||||
all_need_get = #{record.allNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.allNeedPay != null">
|
||||
all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.fax != null">
|
||||
fax = #{record.fax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.telephone != null">
|
||||
telephone = #{record.telephone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.address != null">
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.taxNum != null">
|
||||
tax_num = #{record.taxNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.bankName != null">
|
||||
bank_name = #{record.bankName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.accountNumber != null">
|
||||
account_number = #{record.accountNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.taxRate != null">
|
||||
tax_rate = #{record.taxRate,jdbcType=DECIMAL},
|
||||
</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_supplier
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
supplier = #{record.supplier,jdbcType=VARCHAR},
|
||||
contacts = #{record.contacts,jdbcType=VARCHAR},
|
||||
phone_num = #{record.phoneNum,jdbcType=VARCHAR},
|
||||
email = #{record.email,jdbcType=VARCHAR},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
isystem = #{record.isystem,jdbcType=TINYINT},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
enabled = #{record.enabled,jdbcType=BIT},
|
||||
advance_in = #{record.advanceIn,jdbcType=DECIMAL},
|
||||
begin_need_get = #{record.beginNeedGet,jdbcType=DECIMAL},
|
||||
begin_need_pay = #{record.beginNeedPay,jdbcType=DECIMAL},
|
||||
all_need_get = #{record.allNeedGet,jdbcType=DECIMAL},
|
||||
all_need_pay = #{record.allNeedPay,jdbcType=DECIMAL},
|
||||
fax = #{record.fax,jdbcType=VARCHAR},
|
||||
telephone = #{record.telephone,jdbcType=VARCHAR},
|
||||
address = #{record.address,jdbcType=VARCHAR},
|
||||
tax_num = #{record.taxNum,jdbcType=VARCHAR},
|
||||
bank_name = #{record.bankName,jdbcType=VARCHAR},
|
||||
account_number = #{record.accountNumber,jdbcType=VARCHAR},
|
||||
tax_rate = #{record.taxRate,jdbcType=DECIMAL},
|
||||
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.Supplier">
|
||||
update jsh_supplier
|
||||
<set>
|
||||
<if test="supplier != null">
|
||||
supplier = #{supplier,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="contacts != null">
|
||||
contacts = #{contacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phoneNum != null">
|
||||
phone_num = #{phoneNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
isystem = #{isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="enabled != null">
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="advanceIn != null">
|
||||
advance_in = #{advanceIn,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="beginNeedGet != null">
|
||||
begin_need_get = #{beginNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="beginNeedPay != null">
|
||||
begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allNeedGet != null">
|
||||
all_need_get = #{allNeedGet,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="allNeedPay != null">
|
||||
all_need_pay = #{allNeedPay,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="fax != null">
|
||||
fax = #{fax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
telephone = #{telephone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="address != null">
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taxNum != null">
|
||||
tax_num = #{taxNum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bankName != null">
|
||||
bank_name = #{bankName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="accountNumber != null">
|
||||
account_number = #{accountNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="taxRate != null">
|
||||
tax_rate = #{taxRate,jdbcType=DECIMAL},
|
||||
</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.Supplier">
|
||||
update jsh_supplier
|
||||
set supplier = #{supplier,jdbcType=VARCHAR},
|
||||
contacts = #{contacts,jdbcType=VARCHAR},
|
||||
phone_num = #{phoneNum,jdbcType=VARCHAR},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
isystem = #{isystem,jdbcType=TINYINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
enabled = #{enabled,jdbcType=BIT},
|
||||
advance_in = #{advanceIn,jdbcType=DECIMAL},
|
||||
begin_need_get = #{beginNeedGet,jdbcType=DECIMAL},
|
||||
begin_need_pay = #{beginNeedPay,jdbcType=DECIMAL},
|
||||
all_need_get = #{allNeedGet,jdbcType=DECIMAL},
|
||||
all_need_pay = #{allNeedPay,jdbcType=DECIMAL},
|
||||
fax = #{fax,jdbcType=VARCHAR},
|
||||
telephone = #{telephone,jdbcType=VARCHAR},
|
||||
address = #{address,jdbcType=VARCHAR},
|
||||
tax_num = #{taxNum,jdbcType=VARCHAR},
|
||||
bank_name = #{bankName,jdbcType=VARCHAR},
|
||||
account_number = #{accountNumber,jdbcType=VARCHAR},
|
||||
tax_rate = #{taxRate,jdbcType=DECIMAL},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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.SupplierMapperEx">
|
||||
<select id="selectByConditionSupplier" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsBySupplier" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_supplier
|
||||
WHERE 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
</if>
|
||||
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">
|
||||
select *
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null and supplier !=''">
|
||||
and supplier like '%${supplier}%'
|
||||
</if>
|
||||
<if test="type != null and type !=''">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="phonenum != null and phonenum !=''">
|
||||
and phone_num like '%${phonenum}%'
|
||||
</if>
|
||||
<if test="telephone != null and telephone !=''">
|
||||
and telephone like '%${telephone}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
order by id desc
|
||||
</select>
|
||||
<update id="batchDeleteSupplierByIds">
|
||||
update jsh_supplier
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
323
jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapper.xml
Normal file
323
jshERP-boot/src/main/resources/mapper_xml/SystemConfigMapper.xml
Normal file
@@ -0,0 +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.SystemConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.SystemConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
|
||||
<result column="company_contacts" jdbcType="VARCHAR" property="companyContacts" />
|
||||
<result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
|
||||
<result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
|
||||
<result column="company_fax" jdbcType="VARCHAR" property="companyFax" />
|
||||
<result column="company_post_code" jdbcType="VARCHAR" property="companyPostCode" />
|
||||
<result column="depot_flag" jdbcType="VARCHAR" property="depotFlag" />
|
||||
<result column="customer_flag" jdbcType="VARCHAR" property="customerFlag" />
|
||||
<result column="minus_stock_flag" jdbcType="VARCHAR" property="minusStockFlag" />
|
||||
<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, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
|
||||
depot_flag, customer_flag, minus_stock_flag, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_system_config
|
||||
<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_system_config
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_system_config
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample">
|
||||
delete from jsh_system_config
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
|
||||
insert into jsh_system_config (id, company_name, company_contacts,
|
||||
company_address, company_tel, company_fax,
|
||||
company_post_code, depot_flag, customer_flag,
|
||||
minus_stock_flag, tenant_id, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
|
||||
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
|
||||
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
|
||||
#{minusStockFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
|
||||
insert into jsh_system_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="companyName != null">
|
||||
company_name,
|
||||
</if>
|
||||
<if test="companyContacts != null">
|
||||
company_contacts,
|
||||
</if>
|
||||
<if test="companyAddress != null">
|
||||
company_address,
|
||||
</if>
|
||||
<if test="companyTel != null">
|
||||
company_tel,
|
||||
</if>
|
||||
<if test="companyFax != null">
|
||||
company_fax,
|
||||
</if>
|
||||
<if test="companyPostCode != null">
|
||||
company_post_code,
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
depot_flag,
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
customer_flag,
|
||||
</if>
|
||||
<if test="minusStockFlag != null">
|
||||
minus_stock_flag,
|
||||
</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="companyName != null">
|
||||
#{companyName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyContacts != null">
|
||||
#{companyContacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyAddress != null">
|
||||
#{companyAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyTel != null">
|
||||
#{companyTel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyFax != null">
|
||||
#{companyFax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyPostCode != null">
|
||||
#{companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
#{depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
#{customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="minusStockFlag != null">
|
||||
#{minusStockFlag,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.SystemConfigExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_system_config
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_system_config
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.companyName != null">
|
||||
company_name = #{record.companyName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.companyContacts != null">
|
||||
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.companyAddress != null">
|
||||
company_address = #{record.companyAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.companyTel != null">
|
||||
company_tel = #{record.companyTel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.companyFax != null">
|
||||
company_fax = #{record.companyFax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.companyPostCode != null">
|
||||
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.depotFlag != null">
|
||||
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.customerFlag != null">
|
||||
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.minusStockFlag != null">
|
||||
minus_stock_flag = #{record.minusStockFlag,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_system_config
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
company_name = #{record.companyName,jdbcType=VARCHAR},
|
||||
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
|
||||
company_address = #{record.companyAddress,jdbcType=VARCHAR},
|
||||
company_tel = #{record.companyTel,jdbcType=VARCHAR},
|
||||
company_fax = #{record.companyFax,jdbcType=VARCHAR},
|
||||
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
|
||||
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
|
||||
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
|
||||
minus_stock_flag = #{record.minusStockFlag,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.SystemConfig">
|
||||
update jsh_system_config
|
||||
<set>
|
||||
<if test="companyName != null">
|
||||
company_name = #{companyName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyContacts != null">
|
||||
company_contacts = #{companyContacts,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyAddress != null">
|
||||
company_address = #{companyAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyTel != null">
|
||||
company_tel = #{companyTel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyFax != null">
|
||||
company_fax = #{companyFax,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="companyPostCode != null">
|
||||
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="depotFlag != null">
|
||||
depot_flag = #{depotFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="customerFlag != null">
|
||||
customer_flag = #{customerFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="minusStockFlag != null">
|
||||
minus_stock_flag = #{minusStockFlag,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.SystemConfig">
|
||||
update jsh_system_config
|
||||
set company_name = #{companyName,jdbcType=VARCHAR},
|
||||
company_contacts = #{companyContacts,jdbcType=VARCHAR},
|
||||
company_address = #{companyAddress,jdbcType=VARCHAR},
|
||||
company_tel = #{companyTel,jdbcType=VARCHAR},
|
||||
company_fax = #{companyFax,jdbcType=VARCHAR},
|
||||
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
|
||||
depot_flag = #{depotFlag,jdbcType=VARCHAR},
|
||||
customer_flag = #{customerFlag,jdbcType=VARCHAR},
|
||||
minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.SystemConfigMapperEx">
|
||||
<select id="selectByConditionSystemConfig" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="com.jsh.erp.datasource.mappers.SystemConfigMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_system_config
|
||||
where 1=1
|
||||
<if test="companyName != null">
|
||||
and company_name like '%${companyName}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsBySystemConfig" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_system_config
|
||||
WHERE 1=1
|
||||
<if test="companyName != null">
|
||||
and company_name like '%${companyName}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteSystemConfigByIds">
|
||||
update jsh_system_config
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
288
jshERP-boot/src/main/resources/mapper_xml/TenantMapper.xml
Normal file
288
jshERP-boot/src/main/resources/mapper_xml/TenantMapper.xml
Normal file
@@ -0,0 +1,288 @@
|
||||
<?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.TenantMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" property="id" jdbcType="BIGINT" />
|
||||
<result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
|
||||
<result column="login_name" property="loginName" jdbcType="VARCHAR" />
|
||||
<result column="user_num_limit" property="userNumLimit" jdbcType="INTEGER" />
|
||||
<result column="bills_num_limit" property="billsNumLimit" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
</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="(" suffix=")" prefixOverrides="and" >
|
||||
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
|
||||
<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 collection="criterion.value" item="listItem" open="(" close=")" 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, tenant_id, login_name, user_num_limit, bills_num_limit, create_time
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.TenantExample" >
|
||||
<!--
|
||||
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_tenant
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_tenant
|
||||
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_tenant
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.TenantExample" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from jsh_tenant
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_tenant (id, tenant_id, login_name,
|
||||
user_num_limit, bills_num_limit, create_time
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{loginName,jdbcType=VARCHAR},
|
||||
#{userNumLimit,jdbcType=INTEGER}, #{billsNumLimit,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
insert into jsh_tenant
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
login_name,
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
user_num_limit,
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
bills_num_limit,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="tenantId != null" >
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
#{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
#{userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
#{billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultType="java.lang.Integer" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from jsh_tenant
|
||||
<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_tenant
|
||||
<set >
|
||||
<if test="record.id != null" >
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.tenantId != null" >
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.loginName != null" >
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userNumLimit != null" >
|
||||
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.billsNumLimit != null" >
|
||||
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.createTime != null" >
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</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_tenant
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
user_num_limit = #{record.userNumLimit,jdbcType=INTEGER},
|
||||
bills_num_limit = #{record.billsNumLimit,jdbcType=INTEGER},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
<set >
|
||||
<if test="tenantId != null" >
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="loginName != null" >
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userNumLimit != null" >
|
||||
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="billsNumLimit != null" >
|
||||
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Tenant" >
|
||||
<!--
|
||||
WARNING - @mbggenerated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update jsh_tenant
|
||||
set tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
user_num_limit = #{userNumLimit,jdbcType=INTEGER},
|
||||
bills_num_limit = #{billsNumLimit,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
24
jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml
Normal file
24
jshERP-boot/src/main/resources/mapper_xml/TenantMapperEx.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.TenantMapperEx">
|
||||
<select id="selectByConditionTenant" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultMap="com.jsh.erp.datasource.mappers.TenantMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_tenant
|
||||
where 1=1
|
||||
<if test="loginName != null">
|
||||
and login_name like '%${loginName}%'
|
||||
</if>
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByTenant" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_tenant
|
||||
WHERE 1=1
|
||||
<if test="loginName != null">
|
||||
and login_name like '%${loginName}%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
243
jshERP-boot/src/main/resources/mapper_xml/UnitMapper.xml
Normal file
243
jshERP-boot/src/main/resources/mapper_xml/UnitMapper.xml
Normal file
@@ -0,0 +1,243 @@
|
||||
<?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.UnitMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Unit">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="basic_unit" jdbcType="VARCHAR" property="basicUnit" />
|
||||
<result column="other_unit" jdbcType="VARCHAR" property="otherUnit" />
|
||||
<result column="ratio" jdbcType="INTEGER" property="ratio" />
|
||||
<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, name, basic_unit, other_unit, ratio, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UnitExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_unit
|
||||
<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_unit
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_unit
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.UnitExample">
|
||||
delete from jsh_unit
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Unit">
|
||||
insert into jsh_unit (id, name, basic_unit,
|
||||
other_unit, ratio, tenant_id,
|
||||
delete_flag)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{basicUnit,jdbcType=VARCHAR},
|
||||
#{otherUnit,jdbcType=VARCHAR}, #{ratio,jdbcType=INTEGER}, #{tenantId,jdbcType=BIGINT},
|
||||
#{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Unit">
|
||||
insert into jsh_unit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="basicUnit != null">
|
||||
basic_unit,
|
||||
</if>
|
||||
<if test="otherUnit != null">
|
||||
other_unit,
|
||||
</if>
|
||||
<if test="ratio != null">
|
||||
ratio,
|
||||
</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="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="basicUnit != null">
|
||||
#{basicUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherUnit != null">
|
||||
#{otherUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ratio != null">
|
||||
#{ratio,jdbcType=INTEGER},
|
||||
</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.UnitExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_unit
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_unit
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.basicUnit != null">
|
||||
basic_unit = #{record.basicUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.otherUnit != null">
|
||||
other_unit = #{record.otherUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.ratio != null">
|
||||
ratio = #{record.ratio,jdbcType=INTEGER},
|
||||
</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_unit
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
basic_unit = #{record.basicUnit,jdbcType=VARCHAR},
|
||||
other_unit = #{record.otherUnit,jdbcType=VARCHAR},
|
||||
ratio = #{record.ratio,jdbcType=INTEGER},
|
||||
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.Unit">
|
||||
update jsh_unit
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="basicUnit != null">
|
||||
basic_unit = #{basicUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="otherUnit != null">
|
||||
other_unit = #{otherUnit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ratio != null">
|
||||
ratio = #{ratio,jdbcType=INTEGER},
|
||||
</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.Unit">
|
||||
update jsh_unit
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
basic_unit = #{basicUnit,jdbcType=VARCHAR},
|
||||
other_unit = #{otherUnit,jdbcType=VARCHAR},
|
||||
ratio = #{ratio,jdbcType=INTEGER},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
36
jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml
Normal file
36
jshERP-boot/src/main/resources/mapper_xml/UnitMapperEx.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.UnitMapperEx">
|
||||
<select id="selectByConditionUnit" parameterType="com.jsh.erp.datasource.entities.UnitExample" resultMap="com.jsh.erp.datasource.mappers.UnitMapper.BaseResultMap">
|
||||
select *
|
||||
FROM jsh_unit
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByUnit" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM jsh_unit
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and name like '%${name}%'
|
||||
</if>
|
||||
and ifnull(delete_flag,'0') !='1'
|
||||
</select>
|
||||
<update id="batchDeleteUnitByIds">
|
||||
update jsh_unit
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
</mapper>
|
||||
228
jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapper.xml
Normal file
228
jshERP-boot/src/main/resources/mapper_xml/UserBusinessMapper.xml
Normal file
@@ -0,0 +1,228 @@
|
||||
<?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.UserBusinessMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.UserBusiness">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="key_id" jdbcType="VARCHAR" property="keyId" />
|
||||
<result column="value" jdbcType="VARCHAR" property="value" />
|
||||
<result column="btn_str" jdbcType="VARCHAR" property="btnStr" />
|
||||
<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, key_id, value, btn_str, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UserBusinessExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_user_business
|
||||
<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_user_business
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_user_business
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.UserBusinessExample">
|
||||
delete from jsh_user_business
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.UserBusiness">
|
||||
insert into jsh_user_business (id, type, key_id,
|
||||
value, btn_str, delete_flag
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{keyId,jdbcType=VARCHAR},
|
||||
#{value,jdbcType=VARCHAR}, #{btnStr,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.UserBusiness">
|
||||
insert into jsh_user_business
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="keyId != null">
|
||||
key_id,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value,
|
||||
</if>
|
||||
<if test="btnStr != null">
|
||||
btn_str,
|
||||
</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="keyId != null">
|
||||
#{keyId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
#{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="btnStr != null">
|
||||
#{btnStr,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="deleteFlag != null">
|
||||
#{deleteFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.UserBusinessExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_user_business
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_user_business
|
||||
<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.keyId != null">
|
||||
key_id = #{record.keyId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.value != null">
|
||||
value = #{record.value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.btnStr != null">
|
||||
btn_str = #{record.btnStr,jdbcType=VARCHAR},
|
||||
</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_user_business
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
key_id = #{record.keyId,jdbcType=VARCHAR},
|
||||
value = #{record.value,jdbcType=VARCHAR},
|
||||
btn_str = #{record.btnStr,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.UserBusiness">
|
||||
update jsh_user_business
|
||||
<set>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="keyId != null">
|
||||
key_id = #{keyId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value = #{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="btnStr != null">
|
||||
btn_str = #{btnStr,jdbcType=VARCHAR},
|
||||
</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.UserBusiness">
|
||||
update jsh_user_business
|
||||
set type = #{type,jdbcType=VARCHAR},
|
||||
key_id = #{keyId,jdbcType=VARCHAR},
|
||||
value = #{value,jdbcType=VARCHAR},
|
||||
btn_str = #{btnStr,jdbcType=VARCHAR},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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.UserBusinessMapperEx">
|
||||
<update id="batchDeleteUserBusinessByIds">
|
||||
update jsh_user_business
|
||||
set delete_flag='1'
|
||||
where 1=1
|
||||
and id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
353
jshERP-boot/src/main/resources/mapper_xml/UserMapper.xml
Normal file
353
jshERP-boot/src/main/resources/mapper_xml/UserMapper.xml
Normal file
@@ -0,0 +1,353 @@
|
||||
<?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.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.User">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="username" jdbcType="VARCHAR" property="username" />
|
||||
<result column="login_name" jdbcType="VARCHAR" property="loginName" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="position" jdbcType="VARCHAR" property="position" />
|
||||
<result column="department" jdbcType="VARCHAR" property="department" />
|
||||
<result column="email" jdbcType="VARCHAR" property="email" />
|
||||
<result column="phonenum" jdbcType="VARCHAR" property="phonenum" />
|
||||
<result column="ismanager" jdbcType="TINYINT" property="ismanager" />
|
||||
<result column="isystem" jdbcType="TINYINT" property="isystem" />
|
||||
<result column="Status" jdbcType="TINYINT" property="status" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
</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, username, login_name, password, position, department, email, phonenum, ismanager,
|
||||
isystem, Status, description, remark, tenant_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from jsh_user
|
||||
<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_user
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from jsh_user
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.UserExample">
|
||||
delete from jsh_user
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
insert into jsh_user (id, username, login_name,
|
||||
password, position, department,
|
||||
email, phonenum, ismanager,
|
||||
isystem, Status, description,
|
||||
remark, tenant_id)
|
||||
values (#{id,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
|
||||
#{password,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
|
||||
#{email,jdbcType=VARCHAR}, #{phonenum,jdbcType=VARCHAR}, #{ismanager,jdbcType=TINYINT},
|
||||
#{isystem,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{description,jdbcType=VARCHAR},
|
||||
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
insert into jsh_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
login_name,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="position != null">
|
||||
position,
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department,
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email,
|
||||
</if>
|
||||
<if test="phonenum != null">
|
||||
phonenum,
|
||||
</if>
|
||||
<if test="ismanager != null">
|
||||
ismanager,
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
isystem,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
Status,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
#{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="position != null">
|
||||
#{position,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
#{department,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
#{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phonenum != null">
|
||||
#{phonenum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ismanager != null">
|
||||
#{ismanager,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
#{isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_user
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update jsh_user
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.username != null">
|
||||
username = #{record.username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.loginName != null">
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.password != null">
|
||||
password = #{record.password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.position != null">
|
||||
position = #{record.position,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.department != null">
|
||||
department = #{record.department,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.email != null">
|
||||
email = #{record.email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.phonenum != null">
|
||||
phonenum = #{record.phonenum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.ismanager != null">
|
||||
ismanager = #{record.ismanager,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.isystem != null">
|
||||
isystem = #{record.isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
Status = #{record.status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.description != null">
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.remark != null">
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update jsh_user
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
username = #{record.username,jdbcType=VARCHAR},
|
||||
login_name = #{record.loginName,jdbcType=VARCHAR},
|
||||
password = #{record.password,jdbcType=VARCHAR},
|
||||
position = #{record.position,jdbcType=VARCHAR},
|
||||
department = #{record.department,jdbcType=VARCHAR},
|
||||
email = #{record.email,jdbcType=VARCHAR},
|
||||
phonenum = #{record.phonenum,jdbcType=VARCHAR},
|
||||
ismanager = #{record.ismanager,jdbcType=TINYINT},
|
||||
isystem = #{record.isystem,jdbcType=TINYINT},
|
||||
Status = #{record.status,jdbcType=TINYINT},
|
||||
description = #{record.description,jdbcType=VARCHAR},
|
||||
remark = #{record.remark,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
update jsh_user
|
||||
<set>
|
||||
<if test="username != null">
|
||||
username = #{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="position != null">
|
||||
position = #{position,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="department != null">
|
||||
department = #{department,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="email != null">
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="phonenum != null">
|
||||
phonenum = #{phonenum,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="ismanager != null">
|
||||
ismanager = #{ismanager,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="isystem != null">
|
||||
isystem = #{isystem,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
Status = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
update jsh_user
|
||||
set username = #{username,jdbcType=VARCHAR},
|
||||
login_name = #{loginName,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
position = #{position,jdbcType=VARCHAR},
|
||||
department = #{department,jdbcType=VARCHAR},
|
||||
email = #{email,jdbcType=VARCHAR},
|
||||
phonenum = #{phonenum,jdbcType=VARCHAR},
|
||||
ismanager = #{ismanager,jdbcType=TINYINT},
|
||||
isystem = #{isystem,jdbcType=TINYINT},
|
||||
Status = #{status,jdbcType=TINYINT},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
125
jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml
Normal file
125
jshERP-boot/src/main/resources/mapper_xml/UserMapperEx.xml
Normal file
@@ -0,0 +1,125 @@
|
||||
<?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.UserMapperEx">
|
||||
<resultMap extends="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.UserEx">
|
||||
<result column="orgaId" jdbcType="BIGINT" property="orgaId" />
|
||||
<result column="org_abr" jdbcType="VARCHAR" property="orgAbr" />
|
||||
<result column="user_blng_orga_dspl_seq" jdbcType="VARCHAR" property="userBlngOrgaDsplSeq" />
|
||||
<result column="orgaUserRelId" jdbcType="BIGINT" property="orgaUserRelId" />
|
||||
<result column="roleId" jdbcType="VARCHAR" property="roleId" />
|
||||
<result column="roleName" jdbcType="VARCHAR" property="roleName" />
|
||||
</resultMap>
|
||||
<select id="selectByConditionUser" parameterType="com.jsh.erp.datasource.entities.UserExample" resultMap="ResultMapEx">
|
||||
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
|
||||
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,
|
||||
rel.user_blng_orga_dspl_seq,rel.id as orgaUserRelId,
|
||||
(select r.id from jsh_user_business ub
|
||||
inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
|
||||
where ub.type='UserRole' and ub.key_id=user.id limit 0,1) roleId,
|
||||
(select r.name from jsh_user_business ub
|
||||
inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
|
||||
where ub.type='UserRole' and ub.key_id=user.id limit 0,1) roleName
|
||||
FROM jsh_user user
|
||||
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
|
||||
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.delete_flag,'0') !='1'
|
||||
where 1=1
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
<if test="userName != null">
|
||||
and user.username like '%${userName}%'
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
and user.login_name like '%${loginName}%'
|
||||
</if>
|
||||
order by rel.user_blng_orga_dspl_seq,user.id desc
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
<select id="countsByUser" resultType="java.lang.Long">
|
||||
select count(user.id)
|
||||
FROM jsh_user user
|
||||
where 1=1
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
<if test="userName != null">
|
||||
and user.username like '%${userName}%'
|
||||
</if>
|
||||
<if test="loginName != null">
|
||||
and user.login_name like '%${loginName}%'
|
||||
</if>
|
||||
</select>
|
||||
<select id="getUserListByUserNameOrLoginName" resultMap="com.jsh.erp.datasource.mappers.UserMapper.BaseResultMap">
|
||||
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
|
||||
user.description, user.remark,user.isystem
|
||||
FROM jsh_user user
|
||||
where 1=1
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
<if test="userName != null and userName != ''">
|
||||
and user.userName = #{userName}
|
||||
</if>
|
||||
<if test="loginName != null and loginName != ''">
|
||||
and user.login_name = #{loginName}
|
||||
</if>
|
||||
order by user.id desc
|
||||
</select>
|
||||
<update id="batDeleteOrUpdateUser">
|
||||
update jsh_user
|
||||
set status=#{status}
|
||||
where id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</update>
|
||||
<resultMap id="BaseTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNodeEx">
|
||||
<result column="id" property="id"/>
|
||||
<result column="text" property="text"/>
|
||||
<association property="attributes" javaType="com.jsh.erp.datasource.vo.NodeAttributes">
|
||||
<id column="orgNo" property="no"></id>
|
||||
<result column="type" property="type"></result>
|
||||
</association>
|
||||
<collection column="{orgId=id,orgNo=orgNo}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="NextTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNodeEx">
|
||||
<result column="id" property="id"/>
|
||||
<result column="text" property="text"/>
|
||||
<result column="iconCls" property="iconCls"/>
|
||||
<association property="attributes" javaType="com.jsh.erp.datasource.vo.NodeAttributes">
|
||||
<id column="orgNo" property="no"></id>
|
||||
<result column="type" property="type"></result>
|
||||
</association>
|
||||
<collection column="{orgId=id,orgNo=orgNo}" property="children" javaType="java.util.ArrayList"
|
||||
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
|
||||
select id , text,orgNo,sort ,iconCls,type from (
|
||||
SELECT
|
||||
org.id, org.org_abr as text,org.org_no as orgNo,org.sort as sort,null as iconCls,'0' as type
|
||||
FROM jsh_organization org
|
||||
WHERE org.org_parent_no = #{orgNo}
|
||||
and ifnull(org.org_stcd,'0') !='5'
|
||||
union all
|
||||
select
|
||||
user.id,user.username as text, null as orgNo,rel.user_blng_orga_dspl_seq as sort,'icon-user' as iconCls,'1' as type
|
||||
from jsh_user user,jsh_orga_user_rel rel
|
||||
where
|
||||
1=1
|
||||
and user.id=rel.user_id
|
||||
and rel.orga_id=#{orgId}
|
||||
and ifnull(rel.delete_flag,'0') !='1'
|
||||
and ifnull(user.status,'0') not in('1','2')
|
||||
) node
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="getNodeTree" resultMap="BaseTreeResultMap">
|
||||
SELECT
|
||||
id, org_abr as text,org_no as orgNo,'0' as type
|
||||
FROM jsh_organization
|
||||
WHERE org_parent_no = -1
|
||||
and ifnull(org_stcd,'0') !='5'
|
||||
order by sort asc
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user