从源更新

This commit is contained in:
caijulong
2019-11-01 15:55:03 +08:00
486 changed files with 133424 additions and 9281 deletions

View File

@@ -1,458 +0,0 @@
<?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.AppMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.App">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="Id" jdbcType="BIGINT" property="id" />
<result column="Number" jdbcType="VARCHAR" property="number" />
<result column="Name" jdbcType="VARCHAR" property="name" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="Icon" jdbcType="VARCHAR" property="icon" />
<result column="URL" jdbcType="VARCHAR" property="url" />
<result column="Width" jdbcType="VARCHAR" property="width" />
<result column="Height" jdbcType="VARCHAR" property="height" />
<result column="ReSize" jdbcType="BIT" property="resize" />
<result column="OpenMax" jdbcType="BIT" property="openmax" />
<result column="Flash" jdbcType="BIT" property="flash" />
<result column="ZL" jdbcType="VARCHAR" property="zl" />
<result column="Sort" jdbcType="VARCHAR" property="sort" />
<result column="Remark" jdbcType="VARCHAR" property="remark" />
<result column="Enabled" jdbcType="BIT" property="enabled" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<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, Number, Name, Type, Icon, URL, Width, Height, ReSize, OpenMax, Flash, ZL, Sort,
Remark, Enabled, delete_Flag, tenant_id
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.AppExample" 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_app
<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_app
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_app
where Id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.AppExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_app
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.App">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_app (Id, Number, Name,
Type, Icon, URL, Width,
Height, ReSize, OpenMax, Flash,
ZL, Sort, Remark, Enabled,
delete_Flag, tenant_id)
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{width,jdbcType=VARCHAR},
#{height,jdbcType=VARCHAR}, #{resize,jdbcType=BIT}, #{openmax,jdbcType=BIT}, #{flash,jdbcType=BIT},
#{zl,jdbcType=VARCHAR}, #{sort,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT},
#{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.App">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_app
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
Id,
</if>
<if test="number != null">
Number,
</if>
<if test="name != null">
Name,
</if>
<if test="type != null">
Type,
</if>
<if test="icon != null">
Icon,
</if>
<if test="url != null">
URL,
</if>
<if test="width != null">
Width,
</if>
<if test="height != null">
Height,
</if>
<if test="resize != null">
ReSize,
</if>
<if test="openmax != null">
OpenMax,
</if>
<if test="flash != null">
Flash,
</if>
<if test="zl != null">
ZL,
</if>
<if test="sort != null">
Sort,
</if>
<if test="remark != null">
Remark,
</if>
<if test="enabled != null">
Enabled,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
<if test="tenantId != null">
tenant_id,
</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="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="width != null">
#{width,jdbcType=VARCHAR},
</if>
<if test="height != null">
#{height,jdbcType=VARCHAR},
</if>
<if test="resize != null">
#{resize,jdbcType=BIT},
</if>
<if test="openmax != null">
#{openmax,jdbcType=BIT},
</if>
<if test="flash != null">
#{flash,jdbcType=BIT},
</if>
<if test="zl != null">
#{zl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="enabled != null">
#{enabled,jdbcType=BIT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.AppExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_app
<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_app
<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.type != null">
Type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
Icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.url != null">
URL = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.width != null">
Width = #{record.width,jdbcType=VARCHAR},
</if>
<if test="record.height != null">
Height = #{record.height,jdbcType=VARCHAR},
</if>
<if test="record.resize != null">
ReSize = #{record.resize,jdbcType=BIT},
</if>
<if test="record.openmax != null">
OpenMax = #{record.openmax,jdbcType=BIT},
</if>
<if test="record.flash != null">
Flash = #{record.flash,jdbcType=BIT},
</if>
<if test="record.zl != null">
ZL = #{record.zl,jdbcType=VARCHAR},
</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.enabled != null">
Enabled = #{record.enabled,jdbcType=BIT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,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">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_app
set Id = #{record.id,jdbcType=BIGINT},
Number = #{record.number,jdbcType=VARCHAR},
Name = #{record.name,jdbcType=VARCHAR},
Type = #{record.type,jdbcType=VARCHAR},
Icon = #{record.icon,jdbcType=VARCHAR},
URL = #{record.url,jdbcType=VARCHAR},
Width = #{record.width,jdbcType=VARCHAR},
Height = #{record.height,jdbcType=VARCHAR},
ReSize = #{record.resize,jdbcType=BIT},
OpenMax = #{record.openmax,jdbcType=BIT},
Flash = #{record.flash,jdbcType=BIT},
ZL = #{record.zl,jdbcType=VARCHAR},
Sort = #{record.sort,jdbcType=VARCHAR},
Remark = #{record.remark,jdbcType=VARCHAR},
Enabled = #{record.enabled,jdbcType=BIT},
delete_Flag = #{record.deleteFlag,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.App">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_app
<set>
<if test="number != null">
Number = #{number,jdbcType=VARCHAR},
</if>
<if test="name != null">
Name = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
Type = #{type,jdbcType=VARCHAR},
</if>
<if test="icon != null">
Icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="url != null">
URL = #{url,jdbcType=VARCHAR},
</if>
<if test="width != null">
Width = #{width,jdbcType=VARCHAR},
</if>
<if test="height != null">
Height = #{height,jdbcType=VARCHAR},
</if>
<if test="resize != null">
ReSize = #{resize,jdbcType=BIT},
</if>
<if test="openmax != null">
OpenMax = #{openmax,jdbcType=BIT},
</if>
<if test="flash != null">
Flash = #{flash,jdbcType=BIT},
</if>
<if test="zl != null">
ZL = #{zl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
Sort = #{sort,jdbcType=VARCHAR},
</if>
<if test="remark != null">
Remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="enabled != null">
Enabled = #{enabled,jdbcType=BIT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,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.App">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_app
set Number = #{number,jdbcType=VARCHAR},
Name = #{name,jdbcType=VARCHAR},
Type = #{type,jdbcType=VARCHAR},
Icon = #{icon,jdbcType=VARCHAR},
URL = #{url,jdbcType=VARCHAR},
Width = #{width,jdbcType=VARCHAR},
Height = #{height,jdbcType=VARCHAR},
ReSize = #{resize,jdbcType=BIT},
OpenMax = #{openmax,jdbcType=BIT},
Flash = #{flash,jdbcType=BIT},
ZL = #{zl,jdbcType=VARCHAR},
Sort = #{sort,jdbcType=VARCHAR},
Remark = #{remark,jdbcType=VARCHAR},
Enabled = #{enabled,jdbcType=BIT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,45 +0,0 @@
<?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.AppMapperEx">
<select id="selectByConditionApp" parameterType="com.jsh.erp.datasource.entities.AppExample" resultMap="com.jsh.erp.datasource.mappers.AppMapper.BaseResultMap">
select *
FROM jsh_app
where 1=1
<if test="name != null and name != ''">
<bind name="name" value="'%' + _parameter.name + '%'"/>
and name like #{name}
</if>
<if test="type != null and type != ''">
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="countsByApp" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_app
WHERE 1=1
<if test="name != null and name != ''">
<bind name="name" value="'%' + _parameter.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="batchDeleteAppByIds">
update jsh_app
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>

View File

@@ -3,9 +3,11 @@
<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="ProjectName" jdbcType="VARCHAR" property="projectName" />
<result column="OrganName" jdbcType="VARCHAR" property="organName" />
<result column="HandsPersonName" jdbcType="VARCHAR" property="handsPersonName" />
<result column="AccountName" jdbcType="VARCHAR" property="accountName" />
<result column="AllocationProjectName" jdbcType="VARCHAR" property="allocationProjectName" />
</resultMap>
<resultMap id="ResultWithInfoExMap" type="com.jsh.erp.datasource.vo.DepotHeadVo4InDetail">
@@ -45,6 +47,9 @@
left join jsh_supplier s on dh.OrganId=s.id and ifnull(s.delete_Flag,'0') !='1'
left join jsh_person p on dh.HandsPersonId=p.id and ifnull(p.delete_Flag,'0') !='1'
left join jsh_account a on dh.AccountId=a.id and ifnull(a.delete_Flag,'0') !='1'
left join jsh_depot dd on dh.AllocationProjectId=dd.id and ifnull(dd.delete_Flag,'0') !='1'
left join jsh_depotitem di on dh.Id = di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_material m on di.MaterialId = m.Id and ifnull(m.delete_Flag,'0') !='1'
where 1=1
<if test="type != null and type != ''">
and dh.Type=#{type}
@@ -130,7 +135,9 @@
</if>
)
</select>
<select id="getMaxId" resultType="java.lang.Long">
select max(Id) as Id from jsh_depothead
</select>
<select id="findMaterialsListByHeaderId" resultType="java.lang.String">
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
@@ -242,7 +249,7 @@
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
from jsh_material
INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m
on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime}
@@ -271,7 +278,7 @@
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
INNER JOIN (SELECT jsh_material.id,jsh_material.name mName, Model,jsh_materialcategory.`Name` categoryName
from jsh_material
INNER JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
LEFT JOIN jsh_materialcategory on jsh_material.CategoryId=jsh_materialcategory.Id and ifnull(jsh_materialcategory.status,'0') !='2'
where ifnull(jsh_material.delete_Flag,'0') !='1'
) m on m.Id=di.MaterialId where dh.type=#{type} and dh.OperTime >=#{beginTime} and dh.OperTime &lt;=#{endTime}
<if test="oId != null">
@@ -541,4 +548,29 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select id="getBuyAndSaleStatistics" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(DiscountLastMoney),0)
FROM jsh_depothead
WHERE 1=1
<if test="type != null">
and Type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
</if>
<if test="hasSupplier == 1">
and OrganId is not null
</if>
<if test="hasSupplier == 0">
and OrganId is null
</if>
<if test="beginTime != null">
and OperTime >= '${beginTime}'
</if>
<if test="endTime != null">
and OperTime &lt;= '${endTime}'
</if>
and ifnull(delete_Flag,'0') !='1'
</select>
</mapper>

View File

@@ -37,8 +37,12 @@
<result column="MName" jdbcType="VARCHAR" property="MName" />
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
<result column="UName" jdbcType="VARCHAR" property="UName" />
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
<result column="PresetPriceOne" jdbcType="DECIMAL" property="presetPriceOne" />
<result column="PriceStrategy" jdbcType="VARCHAR" property="priceStrategy" />
</resultMap>
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
@@ -52,6 +56,11 @@
<result column="BasicLinjieNumber" jdbcType="DECIMAL" property="BasicLinjieNumber" />
</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_depotitem
@@ -72,6 +81,7 @@
limit #{offset},#{rows}
</if>
</select>
<select id="countsByDepotItem" resultType="java.lang.Long">
SELECT
COUNT(id)
@@ -103,6 +113,17 @@
else 0 end as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime,
depot.name as depotName,depotIn.name as depotInName
case
when type='入库' then ifnull(di.BasicNumber,0)
when type='出库' then 0-di.BasicNumber
when dh.SubType='组装单' and di.MType='组合件' then ifnull(di.BasicNumber,0)
when dh.SubType='组装单' and di.MType='普通子件' then 0-di.BasicNumber
when dh.SubType='拆卸单' and di.MType='普通子件' then ifnull(di.BasicNumber,0)
when dh.SubType='拆卸单' and di.MType='组合件' then 0-di.BasicNumber
else 0
end
as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
left join jsh_depot depot on depot.id=di.depotId and ifnull(depot.delete_Flag,'0') !='1'
@@ -110,12 +131,17 @@
where 1=1
and dh.SubType not in('采购订单','销售订单')
and di.MaterialId =#{mId}
where ((dh.type!='其它' and dh.SubType!='调拨')
or (dh.type='其它' and dh.SubType='组装单')
or (dh.type='其它' and dh.SubType='拆卸单'))
and di.MaterialId =${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_depothead dh
@@ -127,45 +153,6 @@
and di.MaterialId =#{mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findStockNumByMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultAndMaterialMap">
select di.*,m.Name mName,m.Model mModel from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.Id and ifnull(m.delete_Flag,'0') !='1'
where 1=1
<if test="mId != null">
and di.MaterialId=#{mId}
</if>
and ifnull(di.delete_Flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="findStockNumByMaterialIdCounts" resultType="java.lang.Long">
select count(*) from jsh_depotitem where 1=1
<if test="mId != null">
and MaterialId=#{mId}
</if>
and ifnull(delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndMaterialIdIn" resultType="java.lang.Long">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='入库'
and di.MaterialId = #{mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndMaterialIdOut" resultType="java.lang.Long">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
where dh.type='出库'
and dh.SubType!='调拨'
and di.MaterialId = #{mId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndDepotIdAndMaterialIdIn" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
@@ -173,7 +160,6 @@
and di.MaterialId = #{mId} and di.DepotId = #{depotId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="findByTypeAndDepotIdAndMaterialIdOut" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
@@ -182,7 +168,6 @@
and di.MaterialId = #{mId} and di.DepotId = #{depotId}
and ifnull(dh.delete_Flag,'0') !='1'
</select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
select di.*,m.Name MName,m.Model MModel,m.Unit MaterialUnit,m.Color MColor,m.Standard MStandard,m.Mfrs MMfrs,
m.OtherField1 MOtherField1,m.OtherField2 MOtherField2,m.OtherField3 MOtherField3,
@@ -201,6 +186,7 @@
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
from jsh_depotitem di
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1
<if test="headIds != null and headIds != ''">
and di.HeaderId in
@@ -242,183 +228,19 @@
group by m.id) cc
</select>
<select id="findByTypeInIsPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and
((dh.type='入库' and di.DepotId=#{ProjectId})
or
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
or
(di.AnotherDepotId=#{ProjectId}))
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &lt; #{MonthTime}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findByTypeInIsNotPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and
((dh.type='入库' and di.DepotId=#{ProjectId})
or
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
or
(di.AnotherDepotId=#{ProjectId}))
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findByTypeOutIsPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type='出库'
and di.DepotId= #{ProjectId}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &lt; #{MonthTime}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and dh.type='出库'
and di.DepotId= #{ProjectId}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findPriceByTypeInIsPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and
((dh.type='入库' and di.DepotId=#{ProjectId})
or
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
or
(di.AnotherDepotId=#{ProjectId}))
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &lt; #{MonthTime}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findPriceByTypeInIsNotPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and
((dh.type='入库' and di.DepotId=#{ProjectId})
or
(dh.SubType='调拨' and di.AnotherDepotId=#{ProjectId})
or
(di.AnotherDepotId=#{ProjectId}))
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findPriceByTypeOutIsPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and dh.type='出库'
and di.DepotId= #{ProjectId}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &lt; #{MonthTime}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findPriceByTypeOutIsNotPrev" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id and dh.type='出库'
and di.DepotId= #{ProjectId}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findAssembleIsPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.SubType= #{subType}
and di.MType= #{mType}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTime" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &lt; #{MonthTime}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findAssembleIsNotPrev" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.SubType= #{subType}
and di.MType= #{mType}
and di.MaterialId = #{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type=#{type} and dh.subType=#{subType}
and di.MaterialId =#{MId}
<if test="MonthTime != null and MonthTime != ''">
<bind name="MonthTimeStart" value="_parameter.MonthTime + '-01 00:00:00'"/>
and dh.OperTime &gt;= #{MonthTimeStart}
<bind name="MonthTimeEnd" value="_parameter.MonthTime + '-31 23:59:59'"/>
and dh.OperTime &lt;= #{MonthTimeEnd}
</if>
and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =${MId}
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="buyOrSalePrice" resultType="java.math.BigDecimal">
select sum(AllPrice) as AllPrice from jsh_depotitem di,jsh_depothead dh
select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type=#{type} and dh.subType=#{subType}
and di.MaterialId =#{MId}
@@ -432,24 +254,42 @@
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findGiftByTypeIn" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.SubType=#{subType}
and di.AnotherDepotId=#{ProjectId}
and di.MaterialId =#{MId}
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
select ifnull(sum(DiscountLastMoney),0) as allMoney from jsh_depothead dh
where 1=1
and dh.type='${type}' and dh.subType='${subType}'
and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="findGiftByTypeOut" resultType="java.math.BigDecimal">
select sum(BasicNumber) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.SubType=#{subType}
and di.DepotId=#{ProjectId}
and di.MaterialId =#{MId}
<select id="getStockByParam" resultMap="StockMap">
select ifnull((curep.inTotal+curep.transfInTotal+curep.assemInTotal+curep.disAssemInTotal),0) as in_stock,
ifnull((curep.transfOutTotal+curep.outTotal+curep.assemOutTotal+curep.disAssemOutTotal),0) out_stock
from
(select sum(if(dh.type='入库' <if test="depotId != null">and di.DepotId=#{depotId}</if>, di.BasicNumber,0)) as inTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.AnotherDepotId=#{depotId}</if>,di.BasicNumber,0)) as transfInTotal,
sum(if(dh.SubType='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as transfOutTotal,
sum(if(dh.type='出库' and dh.SubType!='调拨' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as outTotal,
sum(if(dh.SubType='组装单' and di.MType='组合件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemInTotal,
sum(if(dh.SubType='组装单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as assemOutTotal,
sum(if(dh.SubType='拆卸单' and di.MType='普通子件' <if test="depotId != null">and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemInTotal,
sum(if(dh.SubType='拆卸单' and di.MType='组合件' <if test="depotId != null"> and di.DepotId=#{depotId}</if>,di.BasicNumber,0)) as disAssemOutTotal
from
jsh_depothead dh,jsh_depotitem di
where 1=1
and dh.id=di.HeaderId
and di.MaterialId=#{mId}
<if test="beginTime != null">
and dh.OperTime &gt;= '${beginTime}'
</if>
<if test="endTime != null">
and dh.OperTime &lt;= '${endTime}'
</if>
and dh.tenant_id=#{tenantId}
and di.tenant_id=#{tenantId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') as curep
</select>
<select id="findDepotItemListBydepotheadId" resultType="com.jsh.erp.datasource.entities.DepotItem">
@@ -471,6 +311,7 @@
and ifnull(dep.delete_Flag,'0') !='1'
and ifnull(mat.delete_Flag,'0') !='1'
</select>
<delete id="deleteDepotItemByDepotHeadIds">
delete from jsh_depotitem
where 1=1
@@ -481,6 +322,7 @@
</foreach>
)
</delete>
<update id="batchDeleteDepotItemByDepotHeadIds">
update jsh_depotitem
set delete_Flag='1'
@@ -492,6 +334,7 @@
</foreach>
)
</update>
<update id="batchDeleteDepotItemByIds">
update jsh_depotitem
set delete_Flag='1'
@@ -502,6 +345,7 @@
</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" />
@@ -514,6 +358,7 @@
)
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" />
@@ -527,8 +372,6 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
SELECT
m. NAME MaterialName,
@@ -642,4 +485,9 @@
and ifnull(di.delete_Flag,'0') !='1') as curep
</select>
<select id="getFinishNumber" resultType="java.math.BigDecimal">
select sum(BasicNumber) from jsh_depotitem
where MaterialId=${mid} and headerId
in (select id from jsh_depothead where LinkNumber='${linkNumber}')
</select>
</mapper>

View File

@@ -1,5 +1,5 @@
<?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">
<?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.FunctionsMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Functions">
<!--
@@ -16,6 +16,7 @@
<result column="Enabled" jdbcType="BIT" property="enabled" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="PushBtn" jdbcType="VARCHAR" property="pushbtn" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
</resultMap>
@@ -90,7 +91,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, delete_Flag,
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, icon,delete_Flag,
tenant_id
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultMap="BaseResultMap">
@@ -147,11 +148,11 @@
insert into jsh_functions (Id, Number, Name,
PNumber, URL, State, Sort,
Enabled, Type, PushBtn,
delete_Flag, tenant_id)
delete_Flag, icon,tenant_id)
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{pnumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR},
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
#{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Functions">
<!--
@@ -190,6 +191,9 @@
<if test="pushbtn != null">
PushBtn,
</if>
<if test="icon != null">
icon,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
@@ -228,6 +232,9 @@
<if test="pushbtn != null">
#{pushbtn,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
@@ -283,6 +290,9 @@
<if test="record.pushbtn != null">
PushBtn = #{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>
@@ -310,8 +320,9 @@
Enabled = #{record.enabled,jdbcType=BIT},
Type = #{record.type,jdbcType=VARCHAR},
PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT}
icon = #{record.icon,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -350,6 +361,9 @@
<if test="pushbtn != null">
PushBtn = #{pushbtn,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
@@ -374,8 +388,9 @@
Enabled = #{enabled,jdbcType=BIT},
Type = #{type,jdbcType=VARCHAR},
PushBtn = #{pushbtn,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT}
icon = #{icon,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -31,7 +31,7 @@
</foreach>
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc
order by m.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
@@ -80,7 +80,7 @@
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1
and ifnull(m.delete_Flag,'0') !='1'
ORDER BY Id asc
ORDER BY Id desc
</select>
<update id="updatePriceNullByPrimaryKey" parameterType="java.lang.Long">
@@ -121,7 +121,7 @@
</foreach>
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.id asc
order by m.id desc
</select>
<select id="findByMaterialName" resultType="com.jsh.erp.datasource.entities.Material">
select m.*

View 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>

View File

@@ -0,0 +1,60 @@
<?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>
</mapper>

View File

@@ -25,6 +25,7 @@
and description like #{description}
</if>
and ifnull(delete_Flag,'0') !='1'
order by id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>

View File

@@ -13,6 +13,8 @@
<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="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
@@ -88,7 +90,7 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
tenant_id, delete_Flag
depot_flag, customer_flag, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
<!--
@@ -143,12 +145,12 @@
-->
insert into jsh_systemconfig (id, company_name, company_contacts,
company_address, company_tel, company_fax,
company_post_code, tenant_id, delete_Flag
)
company_post_code, depot_flag, customer_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}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
@@ -178,6 +180,12 @@
<if test="companyPostCode != null">
company_post_code,
</if>
<if test="depotFlag != null">
depot_flag,
</if>
<if test="customerFlag != null">
customer_flag,
</if>
<if test="tenantId != null">
tenant_id,
</if>
@@ -207,6 +215,12 @@
<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="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
@@ -253,6 +267,12 @@
<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.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
@@ -277,6 +297,8 @@
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},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
@@ -308,6 +330,12 @@
<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="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
@@ -329,6 +357,8 @@
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},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}

View 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>

View 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 loginame 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 loginame like '%${loginName}%'
</if>
</select>
</mapper>