package ${basePackage}.repository; import java.math.BigInteger; import java.util.ArrayList; import java.util.Base64; import java.util.List; import java.util.Map; import org.msgpack.MessagePack; import org.springframework.stereotype.Repository; import ${basePackage}.bean.entity.${entityClassSimpleName}; import ${basePackage}.bean.vo.${voClassSimpleName}; import com.taover.repository.CustomJdbcTemplate; import com.taover.util.UtilHttpRequestMap; import com.taover.util.UtilObject; @Repository public class ${repositoryClassSimpleName} extends CustomJdbcTemplate<${entityClassSimpleName}, Integer>{ public ${repositoryClassSimpleName}() throws Exception { super(); } public String getSsidById(Integer id) throws Exception{ MessagePack pack = new MessagePack(); return Base64.getEncoder().encodeToString(pack.write(new Integer[]{id, id, id})); } public Integer getIdBySsid(String ssid) throws Exception{ MessagePack pack = new MessagePack(); return pack.read(Base64.getDecoder().decode(ssid), Integer[].class)[0]; } public Map getVoPage(List condition, Integer page, Integer size) throws Exception{ Map entityData = this.findPageByCondition(condition, page, size); List<${entityClassSimpleName}> entityList = (List<${entityClassSimpleName}>) entityData.get("rows"); List<${voClassSimpleName}> voList = new ArrayList<${voClassSimpleName}>(); for(int i=0; i updateList) throws Exception{ this.updateEntityById(updateList, this.getIdBySsid(ssid)); } public void deleteEntityBySsid(String ssid) throws Exception{ this.deleteEntityByID(this.getIdBySsid(ssid)); } public ${voClassSimpleName} addEntityByMap(Map data) throws Exception{ ${entityClassSimpleName} entityObj = UtilHttpRequestMap.getBeanByMap(data, ${entityClassSimpleName}.class, false, "id"); BigInteger resultId = this.addEntityForAutoincrementId(entityObj); return this.getVoByEntity(this.findEntityByID(resultId.intValue())); } }