执行dao语句修改
This commit is contained in:
parent
a55deefb8b
commit
b4a87d0905
|
@ -9,4 +9,6 @@ import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
|
|||
* @Date 2025/3/13 17:01
|
||||
**/
|
||||
public interface IUAIdentityDao extends IBaseDao<UAIdentityEntity,String> {
|
||||
|
||||
void updateIdentity(UAIdentityEntity entity);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.u8.base.identity.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.u8.base.identity.dao.IUAIdentityDao;
|
||||
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
|
||||
|
@ -12,4 +13,10 @@ import org.springframework.stereotype.Repository;
|
|||
**/
|
||||
@Repository
|
||||
public class UAIdentityDaoImpl extends MybatisGenericDao<UAIdentityEntity,String> implements IUAIdentityDao {
|
||||
|
||||
@Override
|
||||
@DS("#entity.dataSourceCode")
|
||||
public void updateIdentity(UAIdentityEntity entity) {
|
||||
super.update(getSqlIdPrifx()+"UAIdentityEntity_update_iFatherId",entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class UAIdentityServiceImpl extends BaseService<UAIdentityEntity,String>
|
|||
UAIdentityEntity uaIdentityEntity = new UAIdentityEntity();
|
||||
uaIdentityEntity.setCacc_id(acc_id);
|
||||
uaIdentityEntity.setcVouchType(type);
|
||||
List<UAIdentityEntity> list = uaIdentityDao.queryList(uaIdentityEntity,"com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_list_base_cvouchtype");
|
||||
List<UAIdentityEntity> list = (List<UAIdentityEntity>) uaIdentityDao.query(uaIdentityEntity,"com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_list_base_cvouchtype");
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
return list.get(0);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</sql>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="BasPartEntity_list_base" resultMap="get-BasPartEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.BasPartEntity">
|
||||
<select id="entity_list_base" resultMap="get-BasPartEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.BasPartEntity">
|
||||
select
|
||||
<include refid="BasPartEntity_Base_Column_List" />
|
||||
from ${acc_name}bas_part
|
||||
|
@ -23,7 +23,7 @@
|
|||
</trim>
|
||||
</select>
|
||||
|
||||
<insert id="BasPartEntity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.BasPartEntity" >
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.BasPartEntity" >
|
||||
insert into ${acc_name}bas_part (PartId,InvCode )values (#{partId},#{invCode})
|
||||
</insert>
|
||||
|
||||
|
|
|
@ -776,17 +776,17 @@
|
|||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="InventoryEntity_get" resultMap="get-InventoryEntity-result">
|
||||
<select id="entity_get" resultMap="get-InventoryEntity-result">
|
||||
select
|
||||
<include refid="InventoryEntity_Base_Column_List" />
|
||||
from Inventory where id = #{ id } and sts='Y'
|
||||
from ${acc_name}Inventory where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="InventoryEntity_list_base" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
<select id="entity_list_base" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
select
|
||||
<include refid="InventoryEntity_Base_Column_List" />
|
||||
from Inventory
|
||||
from ${acc_name}Inventory
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="cInvCode != null and cInvCode !='' ">cInvCode = #{cInvCode} </if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> and cInvAddCode = #{cInvAddCode}</if>
|
||||
|
@ -1048,8 +1048,8 @@
|
|||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="InventoryEntity_count" resultType="Integer" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
select count(1) from Inventory
|
||||
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
select count(1) from ${acc_name}Inventory
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="cInvCode != null and cInvCode !='' ">cInvCode = #{cInvCode} </if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> and cInvAddCode = #{cInvAddCode} </if>
|
||||
|
@ -1314,10 +1314,10 @@
|
|||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="InventoryEntity_list_like" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
<select id="entity_list_like" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
select
|
||||
<include refid="InventoryEntity_Base_Column_List" />
|
||||
from Inventory
|
||||
from ${acc_name}Inventory
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="cInvCode != null and cInvCode !='' "> cInvCode like concat('%',#{cInvCode},'%') </if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> and cInvAddCode like concat('%',#{cInvAddCode},'%') </if>
|
||||
|
@ -1575,17 +1575,16 @@
|
|||
<if test="bCheckBatch != null and bCheckBatch !='' "> and bCheckBatch like concat('%',#{bCheckBatch},'%') </if>
|
||||
<if test="bMngOldpart != null and bMngOldpart !='' "> and bMngOldpart like concat('%',#{bMngOldpart},'%') </if>
|
||||
<if test="iOldpartMngRule != null and iOldpartMngRule !='' "> and iOldpartMngRule like concat('%',#{iOldpartMngRule},'%') </if>
|
||||
and sts='Y'
|
||||
|
||||
</trim>
|
||||
<if test=" sort =='' "> order by id desc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="InventoryEntity_list_or" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
<select id="entity_list_or" resultMap="get-InventoryEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
select
|
||||
<include refid="InventoryEntity_Base_Column_List" />
|
||||
from Inventory
|
||||
from ${acc_name}Inventory
|
||||
<trim prefix="where" prefixOverrides="or">
|
||||
<if test="cInvCode != null and cInvCode !='' ">cInvCode = #{cInvCode} </if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> or cInvAddCode = #{cInvAddCode} </if>
|
||||
|
@ -1843,14 +1842,13 @@
|
|||
<if test="bCheckBatch != null and bCheckBatch !='' "> or bCheckBatch = #{bCheckBatch} </if>
|
||||
<if test="bMngOldpart != null and bMngOldpart !='' "> or bMngOldpart = #{bMngOldpart} </if>
|
||||
<if test="iOldpartMngRule != null and iOldpartMngRule !='' "> or iOldpartMngRule = #{iOldpartMngRule} </if>
|
||||
and sts='Y'
|
||||
|
||||
</trim>
|
||||
<if test=" sort =='' "> order by id desc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="InventoryEntity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
insert into Inventory(
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
insert into ${acc_name}Inventory(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="cInvCode != null and cInvCode !='' "> cInvCode, </if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> cInvAddCode, </if>
|
||||
|
@ -2374,8 +2372,8 @@
|
|||
</insert>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="InventoryEntity_update" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
update Inventory set
|
||||
<update id="entity_update" parameterType="com.hzya.frame.u8.base.inventory.entity.InventoryEntity">
|
||||
update ${acc_name}Inventory set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="cInvCode != null and cInvCode !='' "> cInvCode = #{cInvCode},</if>
|
||||
<if test="cInvAddCode != null and cInvAddCode !='' "> cInvAddCode = #{cInvAddCode},</if>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="InventorySubEntity_list_base" resultMap="get-InventorySubEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
|
||||
<select id="entity_list_base" resultMap="get-InventorySubEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
|
||||
select
|
||||
<include refid="InventorySubEntity_Base_Column_List" />
|
||||
from ${acc_name}Inventory_Sub
|
||||
|
@ -25,7 +25,7 @@
|
|||
</trim>
|
||||
</select>
|
||||
|
||||
<insert id="InventorySubEntity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity" >
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity" >
|
||||
insert into ${acc_name}Inventory_Sub(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="cInvSubCode != null and cInvSubCode !='' "> cInvSubCode, </if>
|
||||
|
@ -47,7 +47,7 @@
|
|||
</insert>
|
||||
|
||||
<!-- 更新的时候不更新 dInvCreateDatetime建档日期字段-->
|
||||
<update id="InventorySubEntity_update" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
|
||||
<update id="entity_update" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
|
||||
update ${acc_name}Inventory_Sub set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="cInvSubCode != null and cInvSubCode !='' "> cInvSubCode = #{cInvSubCode},</if>
|
||||
|
|
|
@ -21,9 +21,7 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
|
@ -97,7 +95,7 @@ public class InventoryService extends BaseService<InventoryEntity,String> implem
|
|||
List<BasPartEntity> partList = basPartService.query(part);
|
||||
if (CollectionUtils.isEmpty(partList)){
|
||||
UAIdentityEntity uaIdentityEntity = new UAIdentityEntity();
|
||||
uaIdentityEntity.setCacc_id("002");
|
||||
uaIdentityEntity.setCacc_id(entity.getCacc_id());
|
||||
uaIdentityEntity.setcVouchType("bas_part");
|
||||
List<UAIdentityEntity> identityList = uaIdentityService.query(uaIdentityEntity);
|
||||
if (CollectionUtils.isNotEmpty(identityList)){
|
||||
|
@ -108,7 +106,7 @@ public class InventoryService extends BaseService<InventoryEntity,String> implem
|
|||
Integer id_num_add = uaIdentity.getiFatherId()+1;// +1
|
||||
long max_id = 1000000000 + id_num_add;//前面拼接上1000000000
|
||||
//更新最大编号
|
||||
uaIdentity.setCacc_id("002");
|
||||
uaIdentity.setCacc_id(entity.getCacc_id());
|
||||
uaIdentity.setcVouchType("bas_part");
|
||||
//最大号+1
|
||||
UAIdentityEntity identity = new UAIdentityEntity();
|
||||
|
|
Loading…
Reference in New Issue